Skip to content

Commit 41d26bd

Browse files
committed
Lint some files
1 parent ebcc12e commit 41d26bd

File tree

5 files changed

+162
-112
lines changed

5 files changed

+162
-112
lines changed

uncompyle6/bin/pydisassemble.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/usr/bin/env python
22
# Mode: -*- python -*-
33
#
4-
# Copyright (c) 2015-2016, 2018, 2020, 2022 by Rocky Bernstein <[email protected]>
4+
# Copyright (c) 2015-2016, 2018, 2020, 2022-2023 by Rocky Bernstein <[email protected]>
55
#
66
from __future__ import print_function
7-
import sys, os, getopt
7+
8+
import getopt
9+
import os
10+
import sys
811

912
from uncompyle6.code_fns import disassemble_file
1013
from uncompyle6.version import __version__
@@ -40,31 +43,38 @@
4043
-V | --version show version and stop
4144
-h | --help show this message
4245
43-
""".format(program)
46+
""".format(
47+
program
48+
)
49+
50+
PATTERNS = ("*.pyc", "*.pyo")
4451

45-
PATTERNS = ('*.pyc', '*.pyo')
4652

4753
def main():
48-
Usage_short = """usage: %s FILE...
49-
Type -h for for full help.""" % program
54+
Usage_short = (
55+
"""usage: %s FILE...
56+
Type -h for for full help."""
57+
% program
58+
)
5059

5160
if len(sys.argv) == 1:
5261
print("No file(s) given", file=sys.stderr)
5362
print(Usage_short, file=sys.stderr)
5463
sys.exit(1)
5564

5665
try:
57-
opts, files = getopt.getopt(sys.argv[1:], 'hVU',
58-
['help', 'version', 'uncompyle6'])
66+
opts, files = getopt.getopt(
67+
sys.argv[1:], "hVU", ["help", "version", "uncompyle6"]
68+
)
5969
except getopt.GetoptError as e:
60-
print('%s: %s' % (os.path.basename(sys.argv[0]), e), file=sys.stderr)
70+
print("%s: %s" % (os.path.basename(sys.argv[0]), e), file=sys.stderr)
6171
sys.exit(-1)
6272

6373
for opt, val in opts:
64-
if opt in ('-h', '--help'):
74+
if opt in ("-h", "--help"):
6575
print(__doc__)
6676
sys.exit(1)
67-
elif opt in ('-V', '--version'):
77+
elif opt in ("-V", "--version"):
6878
print("%s %s" % (program, __version__))
6979
sys.exit(0)
7080
else:
@@ -76,11 +86,11 @@ def main():
7686
if os.path.exists(files[0]):
7787
disassemble_file(file, sys.stdout)
7888
else:
79-
print("Can't read %s - skipping" % files[0],
80-
file=sys.stderr)
89+
print("Can't read %s - skipping" % files[0], file=sys.stderr)
8190
pass
8291
pass
8392
return
8493

85-
if __name__ == '__main__':
94+
95+
if __name__ == "__main__":
8696
main()

0 commit comments

Comments
 (0)