You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Update scanner demo code
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2016-2019, 2021 by Rocky Bernstein
|
||||
# Copyright (c) 2016-2019, 2021-2022 by Rocky Bernstein
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -63,15 +63,15 @@ class Scanner37(Scanner37Base):
|
||||
return tokens, customize
|
||||
|
||||
if __name__ == "__main__":
|
||||
from uncompyle6 import PYTHON_VERSION
|
||||
if PYTHON_VERSION == 3.7:
|
||||
from xdis.version_info import PYTHON_VERSION_TRIPLE, version_tuple_to_str
|
||||
|
||||
if PYTHON_VERSION_TRIPLE[:2] == (3, 7):
|
||||
import inspect
|
||||
|
||||
co = inspect.currentframe().f_code
|
||||
co = inspect.currentframe().f_code # type: ignore
|
||||
tokens, customize = Scanner37().ingest(co)
|
||||
for t in tokens:
|
||||
print(t.format())
|
||||
pass
|
||||
else:
|
||||
print("Need to be Python 3.7 to demo; I am %s." %
|
||||
PYTHON_VERSION)
|
||||
print("Need to be Python 3.7 to demo; I am version %s" % version_tuple_to_str())
|
||||
|
Reference in New Issue
Block a user