summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-20 22:23:15 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-20 22:23:15 (GMT)
commit0ae0c076615934ed237b412464b49b58c60c0644 (patch)
tree207ecdd2c40c541dfaffb657a7e9b16d6bada6e1 /Python/compile.c
parent1d1e1dba12d48d6d93b09e4bd140962b4c110dfb (diff)
downloadcpython-0ae0c076615934ed237b412464b49b58c60c0644.zip
cpython-0ae0c076615934ed237b412464b49b58c60c0644.tar.gz
cpython-0ae0c076615934ed237b412464b49b58c60c0644.tar.bz2
SF 569257 -- Name mangle double underscored variable names in __slots__.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/compile.c b/Python/compile.c
index b0e125d..fa53b1e 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -928,8 +928,8 @@ com_addname(struct compiling *c, PyObject *v)
return com_add(c, c->c_names, c->c_name_dict, v);
}
-static int
-mangle(char *p, char *name, char *buffer, size_t maxlen)
+int
+_Py_Mangle(char *p, char *name, char *buffer, size_t maxlen)
{
/* Name mangling: __private becomes _classname__private.
This is independent from how the name is used. */
@@ -963,7 +963,7 @@ com_addop_name(struct compiling *c, int op, char *name)
int i;
char buffer[MANGLE_LEN];
- if (mangle(c->c_private, name, buffer, sizeof(buffer)))
+ if (_Py_Mangle(c->c_private, name, buffer, sizeof(buffer)))
name = buffer;
if (name == NULL || (v = PyString_InternFromString(name)) == NULL) {
c->c_errors++;
@@ -1000,7 +1000,7 @@ com_addop_varname(struct compiling *c, int kind, char *name)
int op = STOP_CODE;
char buffer[MANGLE_LEN];
- if (mangle(c->c_private, name, buffer, sizeof(buffer)))
+ if (_Py_Mangle(c->c_private, name, buffer, sizeof(buffer)))
name = buffer;
if (name == NULL || (v = PyString_InternFromString(name)) == NULL) {
c->c_errors++;
@@ -4956,7 +4956,7 @@ symtable_lookup(struct symtable *st, char *name)
PyObject *v;
int flags;
- if (mangle(st->st_private, name, buffer, sizeof(buffer)))
+ if (_Py_Mangle(st->st_private, name, buffer, sizeof(buffer)))
name = buffer;
v = PyDict_GetItemString(st->st_cur->ste_symbols, name);
if (v == NULL) {
@@ -4977,7 +4977,7 @@ symtable_add_def(struct symtable *st, char *name, int flag)
char buffer[MANGLE_LEN];
int ret;
- if (mangle(st->st_private, name, buffer, sizeof(buffer)))
+ if (_Py_Mangle(st->st_private, name, buffer, sizeof(buffer)))
name = buffer;
if ((s = PyString_InternFromString(name)) == NULL)
return -1;