Skip to content

Commit f22e7cd

Browse files
committed
refactor: a better way to explain what warning is being silenced
This only silences the one warning also!
1 parent 0e807d9 commit f22e7cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lab/show_pyc.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,11 @@ def show_file(fname):
183183
print("Odd file:", fname)
184184

185185
def main(args):
186-
# "DeprecationWarning: co_lnotab is deprecated, use co_lines instead."
187-
warnings.filterwarnings("ignore", category=DeprecationWarning)
186+
warnings.filterwarnings(
187+
"ignore",
188+
"co_lnotab is deprecated, use co_lines instead",
189+
category=DeprecationWarning
190+
)
188191
if args[0] == '-c':
189192
show_py_text(" ".join(args[1:]).replace(";", "\n"))
190193
else:

0 commit comments

Comments
 (0)