[SQL-CVS] r4355 - SQLObject/branches/1.0/sqlobject/util
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2011-03-15 14:27:14
|
Author: phd
Date: Tue Mar 15 08:27:03 2011
New Revision: 4355
Log:
SQLObject stopped supporting Python 2.3 long ago.
Modified:
SQLObject/branches/1.0/sqlobject/util/threadinglocal.py
Modified: SQLObject/branches/1.0/sqlobject/util/threadinglocal.py
==============================================================================
--- SQLObject/branches/1.0/sqlobject/util/threadinglocal.py Wed Mar 9 07:37:32 2011 (r4354)
+++ SQLObject/branches/1.0/sqlobject/util/threadinglocal.py Tue Mar 15 08:27:03 2011 (r4355)
@@ -1,35 +1,6 @@
try:
- import threading
+ from threading import local
except ImportError:
# No threads, so "thread local" means process-global
class local(object):
pass
-else:
- try:
- local = threading.local
- except AttributeError:
- # Added in 2.4, but now we'll have to define it ourselves
- import thread
- class local(object):
-
- def __init__(self):
- self.__dict__['__objs'] = {}
-
- def __getattr__(self, attr, g=thread.get_ident):
- try:
- return self.__dict__['__objs'][g()][attr]
- except KeyError:
- raise AttributeError(
- "No variable %s defined for the thread %s"
- % (attr, g()))
-
- def __setattr__(self, attr, value, g=thread.get_ident):
- self.__dict__['__objs'].setdefault(g(), {})[attr] = value
-
- def __delattr__(self, attr, g=thread.get_ident):
- try:
- del self.__dict__['__objs'][g()][attr]
- except KeyError:
- raise AttributeError(
- "No variable %s defined for thread %s"
- % (attr, g()))
|