Fix crashes on the new Python 3.8 alpha
This commit is contained in:
parent
9914e9010c
commit
ba9b0239c7
@ -1061,7 +1061,7 @@ class HyASTCompiler(object):
|
|||||||
expr,
|
expr,
|
||||||
name=fname,
|
name=fname,
|
||||||
args=ast.arguments(
|
args=ast.arguments(
|
||||||
args=[], vararg=None, kwarg=None,
|
args=[], vararg=None, kwarg=None, posonlyargs=[],
|
||||||
kwonlyargs=[], kw_defaults=[], defaults=[]),
|
kwonlyargs=[], kw_defaults=[], defaults=[]),
|
||||||
body=f(parts).stmts,
|
body=f(parts).stmts,
|
||||||
decorator_list=[])
|
decorator_list=[])
|
||||||
@ -1425,6 +1425,7 @@ class HyASTCompiler(object):
|
|||||||
args = ast.arguments(
|
args = ast.arguments(
|
||||||
args=main_args, defaults=defaults,
|
args=main_args, defaults=defaults,
|
||||||
vararg=rest,
|
vararg=rest,
|
||||||
|
posonlyargs=[],
|
||||||
kwonlyargs=kwonly, kw_defaults=kw_defaults,
|
kwonlyargs=kwonly, kw_defaults=kw_defaults,
|
||||||
kwarg=kwargs)
|
kwarg=kwargs)
|
||||||
|
|
||||||
|
11
hy/macros.py
11
hy/macros.py
@ -9,7 +9,7 @@ import traceback
|
|||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
from hy._compat import reraise
|
from hy._compat import reraise, PY38
|
||||||
from hy.models import replace_hy_obj, HyExpression, HySymbol, wrap_value
|
from hy.models import replace_hy_obj, HyExpression, HySymbol, wrap_value
|
||||||
from hy.lex import mangle
|
from hy.lex import mangle
|
||||||
from hy.errors import (HyLanguageError, HyMacroExpansionError, HyTypeError,
|
from hy.errors import (HyLanguageError, HyMacroExpansionError, HyTypeError,
|
||||||
@ -398,7 +398,8 @@ def rename_function(func, new_name):
|
|||||||
|
|
||||||
return _fn
|
return _fn
|
||||||
|
|
||||||
code_obj_args = ['argcount', 'kwonlyargcount', 'nlocals', 'stacksize',
|
code_obj_args = ['argcount', 'posonlyargcount', 'kwonlyargcount', 'nlocals', 'stacksize',
|
||||||
'flags', 'code', 'consts', 'names', 'varnames',
|
'flags', 'code', 'consts', 'names', 'varnames', 'filename', 'name',
|
||||||
'filename', 'name', 'firstlineno', 'lnotab', 'freevars',
|
'firstlineno', 'lnotab', 'freevars', 'cellvars']
|
||||||
'cellvars']
|
if not PY38:
|
||||||
|
code_obj_args.remove("posonlyargcount")
|
||||||
|
Loading…
Reference in New Issue
Block a user