diff options
| author | Shane Harvey <shane.harvey@mongodb.com> | 2017-08-04 08:45:00 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-08-04 08:45:00 (GMT) |
| commit | c4c9866064f03646c686d7e08b00aeb203c35c19 (patch) | |
| tree | 9af64a872544117d7a3f41469b3018555c18e213 /Lib/copyreg.py | |
| parent | 778928b0c7aa438c282727535814d73df850693a (diff) | |
| download | cpython-c4c9866064f03646c686d7e08b00aeb203c35c19.zip cpython-c4c9866064f03646c686d7e08b00aeb203c35c19.tar.gz cpython-c4c9866064f03646c686d7e08b00aeb203c35c19.tar.bz2 | |
bpo-31107: Fix copyreg mangled slot names calculation. (#2989)
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 ed29d71..bbe1af4 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) |
