Author: Armin Rigo <[email protected]>
Branch:
Changeset: r90310:9de068384802
Date: 2017-02-22 17:08 +0000
http://bitbucket.org/pypy/pypy/changeset/9de068384802/
Log: oops, translation fix
diff --git a/pypy/interpreter/astcompiler/ast.py
b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -1318,7 +1318,7 @@
w_level = get_field(space, w_node, 'level', True)
w_lineno = get_field(space, w_node, 'lineno', False)
w_col_offset = get_field(space, w_node, 'col_offset', False)
- _module = space.realtext_w(w_module) if not space.is_none(w_module)
else space.w_None
+ _module = space.realtext_w(w_module) if not space.is_none(w_module)
else None
names_w = space.unpackiterable(w_names)
_names = [alias.from_object(space, w_item) for w_item in names_w]
_level = space.int_w(w_level)
@@ -3415,8 +3415,8 @@
w_defaults = get_field(space, w_node, 'defaults', False)
args_w = space.unpackiterable(w_args)
_args = [expr.from_object(space, w_item) for w_item in args_w]
- _vararg = space.realtext_w(w_vararg) if not space.is_none(w_vararg)
else space.w_None
- _kwarg = space.realtext_w(w_kwarg) if not space.is_none(w_kwarg) else
space.w_None
+ _vararg = space.realtext_w(w_vararg) if not space.is_none(w_vararg)
else None
+ _kwarg = space.realtext_w(w_kwarg) if not space.is_none(w_kwarg) else
None
defaults_w = space.unpackiterable(w_defaults)
_defaults = [expr.from_object(space, w_item) for w_item in defaults_w]
return arguments(_args, _vararg, _kwarg, _defaults)
@@ -3485,7 +3485,7 @@
_name = space.realtext_w(w_name)
if _name is None:
raise_required_value(space, w_node, 'name')
- _asname = space.realtext_w(w_asname) if not space.is_none(w_asname)
else space.w_None
+ _asname = space.realtext_w(w_asname) if not space.is_none(w_asname)
else None
return alias(_name, _asname)
State.ast_type('alias', 'AST', ['name', 'asname'])
diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py
b/pypy/interpreter/astcompiler/tools/asdl_py.py
--- a/pypy/interpreter/astcompiler/tools/asdl_py.py
+++ b/pypy/interpreter/astcompiler/tools/asdl_py.py
@@ -151,7 +151,7 @@
elif field.type in ("identifier",):
if field.opt:
return ("space.realtext_w(%s) if not space.is_none(%s) "
- "else space.w_None" % (value, value))
+ "else None" % (value, value))
return "space.realtext_w(%s)" % (value,)
elif field.type in ("int",):
return "space.int_w(%s)" % (value,)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit