Commit 59aba128 authored by Tim Peters's avatar Tim Peters

Make the classes exposed by threading.py new-style classes. This is

mostly for convenience and to aid debugging.
parent 0939fac7
...@@ -24,13 +24,17 @@ ThreadError = thread.error ...@@ -24,13 +24,17 @@ ThreadError = thread.error
del thread 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 _VERBOSE = False
if __debug__: if __debug__:
class _Verbose: class _Verbose(object):
def __init__(self, verbose=None): def __init__(self, verbose=None):
if verbose is None: if verbose is None:
...@@ -46,7 +50,7 @@ if __debug__: ...@@ -46,7 +50,7 @@ if __debug__:
else: else:
# Disable this when using "python -O" # Disable this when using "python -O"
class _Verbose: class _Verbose(object):
def __init__(self, verbose=None): def __init__(self, verbose=None):
pass pass
def _note(self, *args): def _note(self, *args):
......
...@@ -24,6 +24,9 @@ Extension modules ...@@ -24,6 +24,9 @@ Extension modules
Library Library
------- -------
- The classes in threading.py are now new-style classes. That they
weren't before was an oversight.
- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods - SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
when there are no lines. when there are no lines.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment