diff --git a/lslopt/lslbasefuncs.py b/lslopt/lslbasefuncs.py index e1cae4c..fce3f03 100644 --- a/lslopt/lslbasefuncs.py +++ b/lslopt/lslbasefuncs.py @@ -1982,3 +1982,5 @@ def llXorBase64StringsCorrect(s, xor): if xor[i] == b'\x00': i = 0 return b64encode(ret).decode('utf8') + +lslbasefuncs_used = True diff --git a/lslopt/lslcommon.py b/lslopt/lslcommon.py index 4f45604..a59ca77 100644 --- a/lslopt/lslcommon.py +++ b/lslopt/lslcommon.py @@ -19,6 +19,7 @@ import sys from strutil import * +strutil_used _exclusions = frozenset(('nt','t','name','value','ch', 'X','SEF')) diff --git a/lslopt/lslfuncs.py b/lslopt/lslfuncs.py index 2263512..7b00eaa 100644 --- a/lslopt/lslfuncs.py +++ b/lslopt/lslfuncs.py @@ -20,3 +20,4 @@ from lslopt.lslbasefuncs import * from lslopt.lsljson import * from lslopt.lslextrafuncs import * +lslbasefuncs_used diff --git a/lslopt/lslparse.py b/lslopt/lslparse.py index faf87a7..b3303ff 100644 --- a/lslopt/lslparse.py +++ b/lslopt/lslparse.py @@ -23,6 +23,7 @@ from lslopt.lslcommon import Key, Vector, Quaternion, types, nr from lslopt import lslcommon, lslfuncs from strutil import * +strutil_used import re # Note this module was basically written from bottom to top, which may help diff --git a/run-tests.py b/run-tests.py index 096616d..75c8cce 100755 --- a/run-tests.py +++ b/run-tests.py @@ -56,7 +56,7 @@ try: import difflib except ImportError: difflib = None -if sys.hexversion < 0x3000000: +if sys.version_info.major < 3: from StringIO import StringIO as StringStream else: from io import BytesIO as StringStream diff --git a/strutil.py b/strutil.py index ee464c9..cd8b020 100644 --- a/strutil.py +++ b/strutil.py @@ -22,7 +22,7 @@ import codecs codecs.register(lambda x: codecs.lookup('utf8') if x == 'cp65001' else None) import sys -if sys.hexversion >= 0x3000000: +if sys.version_info.major >= 3: unicode = str unichr = chr def str2u(s, enc=None): @@ -87,3 +87,5 @@ def werr(s): def wout(s): """Write any string to stdout""" sys.stdout.write(any2u(s, sys.stdout)) + +strutil_used = True