diff options
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() |
