Skip to content

Commit

Permalink
Merge pull request #371 from Jongy/teleportation-compat-3-3.8
Browse files Browse the repository at this point in the history
Maintain compatibility of code-tuples between Python versions 3 < .. < 3.7 and > 3.8
  • Loading branch information
comrumino authored Jan 30, 2020
2 parents 82dd5d2 + 6dd6af6 commit 8cf49b4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions rpyc/utils/teleportation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@ def export_function(func):


def _import_codetup(codetup):
if is_py38x:
(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, code, consts, names, varnames,
filename, name, firstlineno, lnotab, freevars, cellvars) = codetup
elif is_py3k:
(argcount, kwonlyargcount, nlocals, stacksize, flags, code, consts, names, varnames,
filename, name, firstlineno, lnotab, freevars, cellvars) = codetup
if is_py3k:
# Handle tuples sent from 3.8 as well as 3 < version < 3.8.
if len(codetup) == 16:
(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, code, consts, names, varnames,
filename, name, firstlineno, lnotab, freevars, cellvars) = codetup
else:
(argcount, kwonlyargcount, nlocals, stacksize, flags, code, consts, names, varnames,
filename, name, firstlineno, lnotab, freevars, cellvars) = codetup
posonlyargcount = 0
else:
(argcount, nlocals, stacksize, flags, code, consts, names, varnames,
filename, name, firstlineno, lnotab, freevars, cellvars) = codetup
Expand Down

0 comments on commit 8cf49b4

Please sign in to comment.