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

Skip to content

Commit a96b0df

Browse files
committed
Patch from SF bug 570483 (Tim Northover).
In a fresh interpreter, type.mro(tuple) would segfault, because PyType_Ready() isn't called for tuple yet. To fix, call PyType_Ready(type) if type->tp_dict is NULL.
1 parent 6351757 commit a96b0df

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/test/test_descr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,6 +3169,12 @@ def __pow__(self, *args):
31693169
except:
31703170
pass
31713171

3172+
if verbose:
3173+
print "Testing SF bug 570483..."
3174+
# Another segfault only when run early
3175+
# (before PyType_Ready(tuple) is called)
3176+
type.mro(tuple)
3177+
31723178
def test_main():
31733179
do_this_first()
31743180
class_docstrings()

0 commit comments

Comments
 (0)