about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2020-06-29 19:47:56 +0200
committertoonn <toonn@toonn.io>2020-06-29 19:47:56 +0200
commit84a1ff6c66d7f4d4a713d432e01aa9272f0d2765 (patch)
tree750c7b7e3b609a9140cb9573cab1897a05868d0a
parent4bb83b37819f5085596a6cd82a5010d5560a5db4 (diff)
downloadranger-84a1ff6c66d7f4d4a713d432e01aa9272f0d2765.tar.gz
Factor PY3 constant out into ranger module
-rw-r--r--ranger/ext/keybinding_parser.py3
-rw-r--r--ranger/ext/widestring.py3
-rw-r--r--ranger/gui/bar.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py
index 8703d458..e7dbcfe0 100644
--- a/ranger/ext/keybinding_parser.py
+++ b/ranger/ext/keybinding_parser.py
@@ -7,7 +7,8 @@ import sys
 import copy
 import curses.ascii
 
-PY3 = sys.version_info[0] >= 3
+from ranger import PY3
+
 digits = set(range(ord('0'), ord('9') + 1))  # pylint: disable=invalid-name
 
 # Arbitrary numbers which are not used with curses.KEY_XYZ
diff --git a/ranger/ext/widestring.py b/ranger/ext/widestring.py
index 390da639..a209e5fe 100644
--- a/ranger/ext/widestring.py
+++ b/ranger/ext/widestring.py
@@ -7,7 +7,8 @@ from __future__ import (absolute_import, division, print_function)
 import sys
 from unicodedata import east_asian_width
 
-PY3 = sys.version_info[0] >= 3
+from ranger import PY3
+
 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 3f4b891c..b02861b6 100644
--- a/ranger/gui/bar.py
+++ b/ranger/gui/bar.py
@@ -5,12 +5,10 @@ from __future__ import (absolute_import, division, print_function)
 
 import sys
 
+from ranger import PY3
 from ranger.ext.widestring import WideString, utf_char_width
 
 
-PY3 = sys.version_info[0] >= 3
-
-
 class Bar(object):
     left = None
     right = None