We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1018fad commit 6193ecdCopy full SHA for 6193ecd
1 file changed
Tools/scripts/generate_opcode_h.py
@@ -32,10 +32,14 @@
32
#endif /* !Py_OPCODE_H */
33
"""
34
35
+import tokenize
36
+
37
38
def main(opcode_py, outfile='Include/opcode.h'):
39
opcode = {}
- exec(open(opcode_py).read(), opcode)
40
+ with tokenize.open(opcode_py) as fp:
41
+ code = fp.read()
42
+ exec(code, opcode)
43
opmap = opcode['opmap']
44
with open(outfile, 'w') as fobj:
45
fobj.write(header)
0 commit comments