diff options
Diffstat (limited to 'Lib/copyreg.py')
-rw-r--r-- | Lib/copyreg.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/copyreg.py b/Lib/copyreg.py index 67f5bb0..cef9984 100644 --- a/Lib/copyreg.py +++ b/Lib/copyreg.py @@ -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) |