mirror of
https://github.com/python/cpython.git
synced 2024-11-30 05:15:14 +08:00
Properly repr classes without module names.
This commit is contained in:
parent
843daa8cad
commit
cf95f9cacb
@ -358,7 +358,7 @@ class_repr(PyClassObject *op)
|
||||
else
|
||||
name = PyString_AsString(op->cl_name);
|
||||
if (mod == NULL || !PyString_Check(mod))
|
||||
return PyString_FromFormat("<class ?.s at %p>", name, op);
|
||||
return PyString_FromFormat("<class ?.%s at %p>", name, op);
|
||||
else
|
||||
return PyString_FromFormat("<class %s.%s at %p>",
|
||||
PyString_AsString(mod),
|
||||
|
Loading…
Reference in New Issue
Block a user