Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 782d8ff

Browse files
author
Michael W. Hudson
committed
Don't intern the filename of a file being compiled.
Hard to believe it ever helped anything, and it hurts finding reference leaks.
1 parent 3f3b668 commit 782d8ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4731,7 +4731,7 @@ jcompile(node *n, const char *filename, struct compiling *base,
47314731
cellvars = dict_keys_inorder(sc.c_cellvars, 0);
47324732
freevars = dict_keys_inorder(sc.c_freevars,
47334733
PyTuple_GET_SIZE(cellvars));
4734-
filename = PyString_InternFromString(sc.c_filename);
4734+
filename = PyString_FromString(sc.c_filename);
47354735
name = PyString_InternFromString(sc.c_name);
47364736
if (!PyErr_Occurred())
47374737
co = PyCode_New(sc.c_argcount,

0 commit comments

Comments
 (0)