diff options
author | Georg Brandl <georg@python.org> | 2008-06-13 06:32:25 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-13 06:32:25 (GMT) |
commit | f992640ed39d2865920237a3454bdffb117fe6bc (patch) | |
tree | 2687db169d72a803ee9ef2411ee085532dcbe02a /Lib/decimal.py | |
parent | 7634ff5ad6d141cab8d33fcff788b65e064a8104 (diff) | |
download | cpython-f992640ed39d2865920237a3454bdffb117fe6bc.zip cpython-f992640ed39d2865920237a3454bdffb117fe6bc.tar.gz cpython-f992640ed39d2865920237a3454bdffb117fe6bc.tar.bz2 |
Fix last traces of old threading API.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index a61025a..e1d69fd 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -383,7 +383,7 @@ _condition_map = {ConversionSyntax:InvalidOperation, # The getcontext() and setcontext() function manage access to a thread-local # current context. Py2.4 offers direct support for thread locals. If that -# is not available, use threading.currentThread() which is slower but will +# is not available, use threading.current_thread() which is slower but will # work for older Pythons. If threads are not part of the build, create a # mock threading object with threading.local() returning the module namespace. @@ -405,15 +405,15 @@ except AttributeError: # To fix reloading, force it to create a new context # Old contexts have different exceptions in their dicts, making problems. - if hasattr(threading.currentThread(), '__decimal_context__'): - del threading.currentThread().__decimal_context__ + if hasattr(threading.current_thread(), '__decimal_context__'): + del threading.current_thread().__decimal_context__ def setcontext(context): """Set this thread's context to context.""" if context in (DefaultContext, BasicContext, ExtendedContext): context = context.copy() context.clear_flags() - threading.currentThread().__decimal_context__ = context + threading.current_thread().__decimal_context__ = context def getcontext(): """Returns this thread's context. @@ -423,10 +423,10 @@ except AttributeError: New contexts are copies of DefaultContext. """ try: - return threading.currentThread().__decimal_context__ + return threading.current_thread().__decimal_context__ except AttributeError: context = Context() - threading.currentThread().__decimal_context__ = context + threading.current_thread().__decimal_context__ = context return context else: |