Skip to content

Commit e1ec853

Browse files
committed
Avoid a useless attribute on builtin Entry items in many cases.
1 parent d5eca22 commit e1ec853

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Cython/Compiler/Symtab.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,8 @@ def declare_builtin_type(self, name, cname, utility_code=None,
13371337
type.set_scope(scope)
13381338
self.type_names[name] = 1
13391339
entry = self.declare_type(name, type, None, visibility='extern')
1340-
entry.utility_code = utility_code
1340+
if utility_code:
1341+
entry.utility_code = utility_code
13411342

13421343
var_entry = Entry(
13431344
name=entry.name,
@@ -1350,7 +1351,8 @@ def declare_builtin_type(self, name, cname, utility_code=None,
13501351
var_entry.is_cglobal = 1
13511352
var_entry.is_readonly = 1
13521353
var_entry.is_builtin = 1
1353-
var_entry.utility_code = utility_code
1354+
if utility_code:
1355+
var_entry.utility_code = utility_code
13541356
var_entry.scope = self
13551357
if Options.cache_builtins:
13561358
var_entry.is_const = True

0 commit comments

Comments
 (0)