about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-02-07 17:58:13 +0100
committerhut <hut@lepus.uberspace.de>2015-02-08 03:57:06 +0100
commita64b664b303fc9af2ff533683b6dfef460430585 (patch)
treedb737ee51e73417533fb2dcc4d8d5bc66b9d1101
parent38d7f50ca759ba81a75ffee9132693e5d9e1340f (diff)
downloadranger-a64b664b303fc9af2ff533683b6dfef460430585.tar.gz
proper checking for the python version
Let's not force python to jump from version 9 straight to 31, just
because some silly software did fuzzy version checks :D
-rw-r--r--ranger/config/commands.py2
-rw-r--r--ranger/core/loader.py2
-rw-r--r--ranger/core/tab.py4
-rw-r--r--ranger/ext/keybinding_parser.py2
-rw-r--r--ranger/ext/widestring.py2
-rw-r--r--ranger/gui/bar.py2
6 files changed, 7 insertions, 7 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 774618bd..82fc8889 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -791,7 +791,7 @@ class bulkrename(Command):
         from os.path import relpath
         from ranger.container.file import File
         from ranger.ext.shell_escape import shell_escape as esc
-        py3 = sys.version > "3"
+        py3 = sys.version_info.major >= 3
 
         # Create and edit the file list
         filenames = [relpath(f.path, start=self.fm.thisdir.path)
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index 85e2cbb1..3fb2073e 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -134,7 +134,7 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware):
         self.kill_on_pause = kill_on_pause
 
     def generate(self):
-        py3 = sys.version >= '3'
+        py3 = sys.version_info.major >= 3
         if self.input:
             stdin = PIPE
         else:
diff --git a/ranger/core/tab.py b/ranger/core/tab.py
index 7d5b8ee9..ae10d027 100644
--- a/ranger/core/tab.py
+++ b/ranger/core/tab.py
@@ -22,9 +22,9 @@ class Tab(FileManagerAware, SettingsAware):
         # weak references are not equal to the original object when tested with
         # "==", and this breaks _set_thisfile_from_signal and _on_tab_change.
         self.fm.signal_bind('move', self._set_thisfile_from_signal, priority=0.1,
-                weak=(sys.version > '3'))
+                weak=(sys.version_info.major >= 3))
         self.fm.signal_bind('tab.change', self._on_tab_change,
-                weak=(sys.version > '3'))
+                weak=(sys.version_info.major >= 3))
 
     def _set_thisfile_from_signal(self, signal):
         if self == signal.tab:
diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py
index 0fc7e340..b325ad9a 100644
--- a/ranger/ext/keybinding_parser.py
+++ b/ranger/ext/keybinding_parser.py
@@ -5,7 +5,7 @@ import sys
 import copy
 import curses.ascii
 
-PY3 = sys.version > '3'
+PY3 = sys.version_info.major >= 3
 digits = set(range(ord('0'), ord('9')+1))
 
 # Arbitrary numbers which are not used with curses.KEY_XYZ
diff --git a/ranger/ext/widestring.py b/ranger/ext/widestring.py
index 6b00daaf..32aba5c8 100644
--- a/ranger/ext/widestring.py
+++ b/ranger/ext/widestring.py
@@ -5,7 +5,7 @@
 import sys
 from unicodedata import east_asian_width
 
-PY3 = sys.version > '3'
+PY3 = sys.version_info.major >= 3
 ASCIIONLY = set(chr(c) for c in range(1, 128))
 NARROW = 1
 WIDE = 2
diff --git a/ranger/gui/bar.py b/ranger/gui/bar.py
index a65e55bf..b4bfe950 100644
--- a/ranger/gui/bar.py
+++ b/ranger/gui/bar.py
@@ -3,7 +3,7 @@
 
 from ranger.ext.widestring import WideString, utf_char_width
 import sys
-PY3 = sys.version > '3'
+PY3 = sys.version_info.major >= 3
 
 class Bar(object):
     left = None