Skip to content

Commit b0dd7f5

Browse files
committed
Lint
1 parent 1a3f2b8 commit b0dd7f5

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

uncompyle6/code_fns.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2015-2016, 2818-2022 by Rocky Bernstein
1+
# Copyright (c) 2015-2016, 2818-2022, 2024 by Rocky Bernstein
22
# Copyright (c) 2005 by Dan Pascu <[email protected]>
33
# Copyright (c) 2000-2002 by hartmut Goebel <[email protected]>
44
# Copyright (c) 1999 John Aycock
@@ -17,10 +17,12 @@
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

1919
"""
20-
CPython magic- and version- independent disassembly routines
20+
CPython magic- and version-independent disassembly routines
2121
2222
There are two reasons we can't use Python's built-in routines
23-
from dis. First, the bytecode we are extracting may be from a different
23+
from ``dis``.
24+
25+
First, the bytecode we are extracting may be from a different
2426
version of Python (different magic number) than the version of Python
2527
that is doing the extraction.
2628
@@ -39,12 +41,12 @@
3941

4042
def disco(version, co, out=None, is_pypy=False):
4143
"""
42-
diassembles and deparses a given code block 'co'
44+
diassembles and deparses a given code block ``co``.
4345
"""
4446

4547
assert iscode(co)
4648

47-
# store final output stream for case of error
49+
# Store final output stream in case there is an error.
4850
real_out = out or sys.stdout
4951
print("# Python %s" % version_tuple_to_str(version), file=real_out)
5052
if co.co_filename:
@@ -99,7 +101,7 @@ def disco_loop(disasm, queue, real_out):
99101

100102
def disassemble_file(filename, outstream=None):
101103
"""
102-
disassemble Python byte-code file (.pyc)
104+
Disassemble Python byte-code file (.pyc).
103105
104106
If given a Python source file (".py") file, we'll
105107
try to find the corresponding compiled object.
@@ -113,7 +115,6 @@ def disassemble_file(filename, outstream=None):
113115
disco(version, con, outstream)
114116
else:
115117
disco(version, co, outstream, is_pypy=is_pypy)
116-
co = None
117118

118119

119120
def _test():

uncompyle6/parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ def get_python_parser(
669669

670670
version = version[:2]
671671

672+
p = None
673+
672674
# FIXME: there has to be a better way...
673675
# We could do this as a table lookup, but that would force us
674676
# in import all of the parsers all of the time. Perhaps there is

0 commit comments

Comments
 (0)