Skip to content

Commit e6761e1

Browse files
committed
Python flake8 crap
Was testing realgud's C-x!8 (goto flake8 warning/error)
1 parent c7c0a98 commit e6761e1

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

uncompyle6/bin/pydisassemble.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def main():
6262
print(Usage_short, file=sys.stderr)
6363
sys.exit(1)
6464

65-
6665
for file in files:
6766
if os.path.exists(files[0]):
6867
disassemble_file(file, sys.stdout, native)

uncompyle6/bin/uncompile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ def process_func():
224224
except (KeyboardInterrupt, OSError):
225225
pass
226226

227-
228227
if timestamp:
229228
print(time.strftime(timestampfmt))
230229

uncompyle6/parsers/parse2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def add_custom_rules(self, tokens, customize):
272272
continue
273273
elif opname_base in ('BUILD_LIST', 'BUILD_TUPLE', 'BUILD_SET'):
274274
thousands = (v//1024)
275-
thirty32s = ((v//32)%32)
275+
thirty32s = ((v//32) % 32)
276276
if thirty32s > 0:
277277
rule = "expr32 ::=%s" % (' expr' * 32)
278278
self.add_unique_rule(rule, opname_base, v, customize)

uncompyle6/parsers/parse25.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def add_custom_rules(self, tokens, customize):
4040
if self.version == 2.5:
4141
self.check_reduce['tryelsestmt'] = 'tokens'
4242

43-
4443
def reduce_is_invalid(self, rule, ast, tokens, first, last):
4544
super(Python25Parser, self).reduce_is_invalid(rule, ast, tokens, first, last)
4645

uncompyle6/parsers/parse27.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ class Python27ParserSingle(Python27Parser, PythonParserSingle):
115115
""".split()))
116116
remain_tokens = set(tokens) - opcode_set
117117
import re
118-
remain_tokens = set([re.sub('_\d+$','', t) for t in remain_tokens])
119-
remain_tokens = set([re.sub('_CONT$','', t) for t in remain_tokens])
118+
remain_tokens = set([re.sub('_\d+$', '', t)
119+
for t in remain_tokens])
120+
remain_tokens = set([re.sub('_CONT$', '', t)
121+
for t in remain_tokens])
120122
remain_tokens = set(remain_tokens) - opcode_set
121123
print(remain_tokens)
122124
# p.dumpGrammar()

uncompyle6/parsers/parse3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def add_custom_rules(self, tokens, customize):
550550
elif opname_base in ('BUILD_LIST', 'BUILD_TUPLE', 'BUILD_SET'):
551551
v = token.attr
552552
rule = ('build_list ::= ' + 'expr1024 ' * int(v//1024) +
553-
'expr32 ' * int((v//32)%32) + 'expr '*(v%32) + opname)
553+
'expr32 ' * int((v//32)%32) + 'expr '*(v % 32) + opname)
554554
self.add_unique_rule(rule, opname, token.attr, customize)
555555
if opname_base == 'BUILD_TUPLE':
556556
rule = ('load_closure ::= %s%s' % (('LOAD_CLOSURE ' * v), opname))

uncompyle6/scanners/scanner2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, version, show_asm=None, is_pypy=False):
3737
self.jump_forward = frozenset([self.opc.JUMP_ABSOLUTE, self.opc.JUMP_FORWARD])
3838
# This is the 2.5+ default
3939
# For <2.5 it is <generator expression>
40-
self.genexpr_name = '<genexpr>';
40+
self.genexpr_name = '<genexpr>'
4141

4242
@staticmethod
4343
def unmangle_name(name, classname):
@@ -68,7 +68,6 @@ def unmangle_code_names(self, co, classname):
6868
varnames = co.co_varnames
6969
return free, names, varnames
7070

71-
7271
def ingest(self, co, classname=None, code_objects={}, show_asm=None):
7372
"""
7473
Pick out tokens from an uncompyle6 code object, and transform them,

uncompyle6/scanners/scanner3.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def ingest(self, co, classname=None, code_objects={}, show_asm=None):
159159

160160
customize = {}
161161
if self.is_pypy:
162-
customize['PyPy'] = 1;
162+
customize['PyPy'] = 1
163163

164164
self.code = array('B', co.co_code)
165165
self.build_lines_data(co)
@@ -699,9 +699,9 @@ def detect_structure(self, offset, targets):
699699
# everything inside inner 'or' jumps and midline ifs
700700
match = self.rem_or(start, self.next_stmt[offset],
701701
self.opc.POP_JUMP_IF_FALSE, target)
702-
## We can't remove mid-line ifs because line structures have changed
703-
## from restructBytecode().
704-
## match = self.remove_mid_line_ifs(match)
702+
# We can't remove mid-line ifs because line structures have changed
703+
# from restructBytecode().
704+
# match = self.remove_mid_line_ifs(match)
705705

706706
# If we still have any offsets in set, start working on it
707707
if match:

0 commit comments

Comments
 (0)