Commit 0ac2fa8a authored by Stefan Behnel's avatar Stefan Behnel

simplify code a bit

parent 6aaa09e2
...@@ -1867,10 +1867,9 @@ class NameNode(AtomicExprNode): ...@@ -1867,10 +1867,9 @@ class NameNode(AtomicExprNode):
else: else:
code.put_error_if_neg(self.pos, del_code) code.put_error_if_neg(self.pos, del_code)
elif self.entry.is_pyglobal: elif self.entry.is_pyglobal:
py_name = code.get_py_string_const( interned_cname = code.intern_identifier(self.entry.name)
self.entry.name, is_str=True, identifier=True)
del_code = 'PyObject_DelAttr(%s, %s)' % ( del_code = 'PyObject_DelAttr(%s, %s)' % (
Naming.module_cname, py_name) Naming.module_cname, interned_cname)
if ignore_nonexisting: if ignore_nonexisting:
code.putln('if (unlikely(%s < 0)) { if (likely(PyErr_ExceptionMatches(PyExc_AttributeError))) PyErr_Clear(); else %s }' % ( code.putln('if (unlikely(%s < 0)) { if (likely(PyErr_ExceptionMatches(PyExc_AttributeError))) PyErr_Clear(); else %s }' % (
del_code, del_code,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment