Style fixes

Calm pyflakes by using identifiers, and change hexversion to version.major.
This commit is contained in:
Sei Lisa 2019-01-18 23:41:45 +01:00
parent 09556d5fbc
commit f0068dd3bc
6 changed files with 9 additions and 2 deletions

View file

@ -1982,3 +1982,5 @@ def llXorBase64StringsCorrect(s, xor):
if xor[i] == b'\x00': if xor[i] == b'\x00':
i = 0 i = 0
return b64encode(ret).decode('utf8') return b64encode(ret).decode('utf8')
lslbasefuncs_used = True

View file

@ -19,6 +19,7 @@
import sys import sys
from strutil import * from strutil import *
strutil_used
_exclusions = frozenset(('nt','t','name','value','ch', 'X','SEF')) _exclusions = frozenset(('nt','t','name','value','ch', 'X','SEF'))

View file

@ -20,3 +20,4 @@
from lslopt.lslbasefuncs import * from lslopt.lslbasefuncs import *
from lslopt.lsljson import * from lslopt.lsljson import *
from lslopt.lslextrafuncs import * from lslopt.lslextrafuncs import *
lslbasefuncs_used

View file

@ -23,6 +23,7 @@
from lslopt.lslcommon import Key, Vector, Quaternion, types, nr from lslopt.lslcommon import Key, Vector, Quaternion, types, nr
from lslopt import lslcommon, lslfuncs from lslopt import lslcommon, lslfuncs
from strutil import * from strutil import *
strutil_used
import re import re
# Note this module was basically written from bottom to top, which may help # Note this module was basically written from bottom to top, which may help

View file

@ -56,7 +56,7 @@ try:
import difflib import difflib
except ImportError: except ImportError:
difflib = None difflib = None
if sys.hexversion < 0x3000000: if sys.version_info.major < 3:
from StringIO import StringIO as StringStream from StringIO import StringIO as StringStream
else: else:
from io import BytesIO as StringStream from io import BytesIO as StringStream

View file

@ -22,7 +22,7 @@ import codecs
codecs.register(lambda x: codecs.lookup('utf8') if x == 'cp65001' else None) codecs.register(lambda x: codecs.lookup('utf8') if x == 'cp65001' else None)
import sys import sys
if sys.hexversion >= 0x3000000: if sys.version_info.major >= 3:
unicode = str unicode = str
unichr = chr unichr = chr
def str2u(s, enc=None): def str2u(s, enc=None):
@ -87,3 +87,5 @@ def werr(s):
def wout(s): def wout(s):
"""Write any string to stdout""" """Write any string to stdout"""
sys.stdout.write(any2u(s, sys.stdout)) sys.stdout.write(any2u(s, sys.stdout))
strutil_used = True