Skip to content

Commit 2e017b8

Browse files
remove template and opname not supported in old python version
1 parent 70fe4f5 commit 2e017b8

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ jobs:
1111
# disabled windows due node packages issues
1212
# os: [ubuntu-latest, macos-latest, windows-latest]
1313
os: [ubuntu-latest, macos-latest]
14-
python-version: [ '2.x', '3.x', '3.5', '3.6', '3.7', '3.8', '3.9', 'pypy-2.7', 'pypy-3.6', 'pypy-3.7' ]
14+
python-version: [ '2.x', '3.x', '3.5', '3.6', '3.7', '3.8', '3.9', 'pypy-2.7', 'pypy-3.6']
1515
exclude:
1616
- os: windows-latest
1717
python-version: '3.5'
1818
- os: macos-latest
1919
python-version: 'pypy-3.6'
20-
- os: macos-latest
21-
python-version: 'pypy-3.7'
2220
name: ${{ matrix.os }} ${{ matrix.arch }}, Python ${{ matrix.python-version }}
2321
steps:
2422
- uses: actions/checkout@v2

js2py/utils/injector.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def append_arguments(code_obj, new_locals):
8383
modified = []
8484
drop_future_cache = False
8585
for inst in instructions(code_obj):
86-
if inst.opname == "CACHE":
86+
if is_new_bytecode and inst.opname == "CACHE":
8787
assert inst.arg == 0
8888
if not drop_future_cache:
8989
modified.extend(write_instruction(inst.opcode, inst.arg))
@@ -252,9 +252,6 @@ def check(code_obj):
252252
'Your python version made changes to the bytecode')
253253

254254

255-
def pi(ins):
256-
return(f"{ins.opname} {ins.arg} {ins.argval}")
257-
258255

259256

260257
def signature(func):
@@ -282,7 +279,7 @@ def compare_func(fake_func, gt_func):
282279
else:
283280
real = real_ins[pos]
284281
fake = e
285-
print(f"POS {pos} OFFSET: {offset} FAKE VS REAL")
282+
print("POS %d OFFSET: %d FAKE VS REAL" % (pos, offset))
286283
print(fake)
287284
print(real)
288285
assert fake.opcode == real.opcode

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# twine upload dist/*
2828
setup(
2929
name='Js2Py',
30-
version='0.72',
30+
version='0.74',
3131

3232
packages=['js2py', 'js2py.utils', 'js2py.prototypes', 'js2py.translators',
3333
'js2py.constructors', 'js2py.host', 'js2py.es6', 'js2py.internals',

0 commit comments

Comments
 (0)