mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-31107: Fix copyreg mangled slot names calculation. (#2989)
This commit is contained in:
parent
778928b0c7
commit
c4c9866064
4 changed files with 18 additions and 1 deletions
|
@ -128,7 +128,11 @@ def _slotnames(cls):
|
|||
continue
|
||||
# mangled names
|
||||
elif name.startswith('__') and not name.endswith('__'):
|
||||
names.append('_%s%s' % (c.__name__, name))
|
||||
stripped = c.__name__.lstrip('_')
|
||||
if stripped:
|
||||
names.append('_%s%s' % (stripped, name))
|
||||
else:
|
||||
names.append(name)
|
||||
else:
|
||||
names.append(name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue