mirror of
https://github.com/python/cpython
synced 2024-09-06 12:50:23 +00:00
Make the classes exposed by threading.py new-style classes. This is
mostly for convenience and to aid debugging.
This commit is contained in:
parent
0939fac795
commit
59aba128a5
|
@ -24,13 +24,17 @@
|
|||
del thread
|
||||
|
||||
|
||||
# Debug support (adapted from ihooks.py)
|
||||
# Debug support (adapted from ihooks.py).
|
||||
# All the major classes here derive from _Verbose. We force that to
|
||||
# be a new-style class so that all the major classes here are new-style.
|
||||
# This helps debugging (type(instance) is more revealing for instances
|
||||
# of new-style classes).
|
||||
|
||||
_VERBOSE = False
|
||||
|
||||
if __debug__:
|
||||
|
||||
class _Verbose:
|
||||
class _Verbose(object):
|
||||
|
||||
def __init__(self, verbose=None):
|
||||
if verbose is None:
|
||||
|
@ -46,7 +50,7 @@ def _note(self, format, *args):
|
|||
|
||||
else:
|
||||
# Disable this when using "python -O"
|
||||
class _Verbose:
|
||||
class _Verbose(object):
|
||||
def __init__(self, verbose=None):
|
||||
pass
|
||||
def _note(self, *args):
|
||||
|
|
Loading…
Reference in a new issue