File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 3131 from sqlalchemy .ext .declarative import declarative_base
3232 from sqlalchemy .ext .declarative import DeclarativeMeta
3333
34+ # Scope the session to the current greenlet if greenlet is available,
35+ # otherwise fall back to the current thread.
36+ try :
37+ from greenlet import getcurrent as _ident_func
38+ except ImportError :
39+ from threading import get_ident as _ident_func
40+
3441__version__ = "2.4.4"
3542
3643# the best timer function for the platform
@@ -772,7 +779,7 @@ def create_scoped_session(self, options=None):
772779 if options is None :
773780 options = {}
774781
775- scopefunc = options .pop ('scopefunc' , _app_ctx_stack . __ident_func__ )
782+ scopefunc = options .pop ('scopefunc' , _ident_func )
776783 options .setdefault ('query_cls' , self .Query )
777784 return orm .scoped_session (
778785 self .create_session (options ), scopefunc = scopefunc
You can’t perform that action at this time.
0 commit comments