diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-10-20 17:33:33 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-10-20 17:33:33 +0000 |
| commit | aceb90525aad6d3e807f5f2db548353a5fc33138 (patch) | |
| tree | 90da11aecbb5f779722ad1be95097f057d0c8882 /lib/sqlalchemy/util.py | |
| parent | 404f43894a63cea858189240c4027a7451b87bf2 (diff) | |
| download | sqlalchemy-aceb90525aad6d3e807f5f2db548353a5fc33138.tar.gz | |
merged scopefunc patch from r6420 of 0.5 branch
Diffstat (limited to 'lib/sqlalchemy/util.py')
| -rw-r--r-- | lib/sqlalchemy/util.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index 8f0b5583d..da426cbd8 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -1180,14 +1180,7 @@ class ScopedRegistry(object): scopefunc a callable that will return a key to store/retrieve an object. - If None, ScopedRegistry uses a threading.local object instead. - """ - def __new__(cls, createfunc, scopefunc=None): - if not scopefunc: - return object.__new__(_TLocalRegistry) - else: - return object.__new__(cls) def __init__(self, createfunc, scopefunc): self.createfunc = createfunc @@ -1213,8 +1206,8 @@ class ScopedRegistry(object): except KeyError: pass -class _TLocalRegistry(ScopedRegistry): - def __init__(self, createfunc, scopefunc=None): +class ThreadLocalRegistry(ScopedRegistry): + def __init__(self, createfunc): self.createfunc = createfunc self.registry = threading.local() |
