Skip to content

Commit

Permalink
remove template and opname not supported in old python version
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrDabkowski committed Nov 6, 2022
1 parent 70fe4f5 commit 2e017b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ jobs:
# disabled windows due node packages issues
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
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' ]
python-version: [ '2.x', '3.x', '3.5', '3.6', '3.7', '3.8', '3.9', 'pypy-2.7', 'pypy-3.6']
exclude:
- os: windows-latest
python-version: '3.5'
- os: macos-latest
python-version: 'pypy-3.6'
- os: macos-latest
python-version: 'pypy-3.7'
name: ${{ matrix.os }} ${{ matrix.arch }}, Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 2 additions & 5 deletions js2py/utils/injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def append_arguments(code_obj, new_locals):
modified = []
drop_future_cache = False
for inst in instructions(code_obj):
if inst.opname == "CACHE":
if is_new_bytecode and inst.opname == "CACHE":
assert inst.arg == 0
if not drop_future_cache:
modified.extend(write_instruction(inst.opcode, inst.arg))
Expand Down Expand Up @@ -252,9 +252,6 @@ def check(code_obj):
'Your python version made changes to the bytecode')


def pi(ins):
return(f"{ins.opname} {ins.arg} {ins.argval}")



def signature(func):
Expand Down Expand Up @@ -282,7 +279,7 @@ def compare_func(fake_func, gt_func):
else:
real = real_ins[pos]
fake = e
print(f"POS {pos} OFFSET: {offset} FAKE VS REAL")
print("POS %d OFFSET: %d FAKE VS REAL" % (pos, offset))
print(fake)
print(real)
assert fake.opcode == real.opcode
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# twine upload dist/*
setup(
name='Js2Py',
version='0.72',
version='0.74',

packages=['js2py', 'js2py.utils', 'js2py.prototypes', 'js2py.translators',
'js2py.constructors', 'js2py.host', 'js2py.es6', 'js2py.internals',
Expand Down

0 comments on commit 2e017b8

Please sign in to comment.