aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2013-10-17 19:09:49 -0700
committerBrian Dolbec <dolsen@gentoo.org>2013-10-17 19:09:49 -0700
commitf727908fd506c0602be6bc8b51d844b978469555 (patch)
tree9a9f4d34c1c4efc32a8f2dca10eadfed92377a69 /mirrorselect
parentget_filesystem_mirrors() cleanup & fixes (diff)
downloadmirrorselect-f727908fd506c0602be6bc8b51d844b978469555.tar.gz
mirrorselect-f727908fd506c0602be6bc8b51d844b978469555.tar.bz2
mirrorselect-f727908fd506c0602be6bc8b51d844b978469555.zip
Improve python version testing for imports.
Use Arfrever's suggested code.
Diffstat (limited to 'mirrorselect')
-rw-r--r--mirrorselect/extractor.py2
-rw-r--r--mirrorselect/mirrorparser3.py2
-rw-r--r--mirrorselect/selectors.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/mirrorselect/extractor.py b/mirrorselect/extractor.py
index 8a3132c..2b7d049 100644
--- a/mirrorselect/extractor.py
+++ b/mirrorselect/extractor.py
@@ -29,7 +29,7 @@ Distributed under the terms of the GNU General Public License v2
import sys
-if int(sys.version[0]) == 3:
+if sys.version_info[0] >= 3:
import urllib.request, urllib.parse, urllib.error
url_parse = urllib.parse
url_open = urllib.request.urlopen
diff --git a/mirrorselect/mirrorparser3.py b/mirrorselect/mirrorparser3.py
index 0db0edb..6b06a9c 100644
--- a/mirrorselect/mirrorparser3.py
+++ b/mirrorselect/mirrorparser3.py
@@ -68,7 +68,7 @@ class MirrorParser3:
if __name__ == '__main__':
import sys
- if int(sys.version[0]) == 3:
+ if sys.version_info[0] >= 3:
import urllib.request, urllib.parse, urllib.error
parser = MirrorParser3()
parser.parse(urllib.request.urlopen(MIRRORS_3_XML).read())
diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py
index 230ca15..d72fd23 100644
--- a/mirrorselect/selectors.py
+++ b/mirrorselect/selectors.py
@@ -36,7 +36,7 @@ import sys
import time
import hashlib
-if int(sys.version[0]) == 3:
+if sys.version_info[0] >= 3:
import urllib.request, urllib.parse, urllib.error
url_parse = urllib.parse.urlparse
url_open = urllib.request.urlopen