Skip to content

Commit 59ede18

Browse files
authored
Merge pull request #937 from pallets/2.7-compat
get_ident compat for Python 2.7
2 parents c11fe63 + 0ac1040 commit 59ede18

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGES.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 2.5.1
2+
-------------
3+
4+
Unreleased
5+
6+
- Fix compatibility with Python 2.7.
7+
8+
19
Version 2.5.0
210
-------------
311

flask_sqlalchemy/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
try:
3737
from greenlet import getcurrent as _ident_func
3838
except ImportError:
39-
from threading import get_ident as _ident_func
39+
try:
40+
from threading import get_ident as _ident_func
41+
except ImportError:
42+
# Python 2.7
43+
from thread import get_ident as _ident_func
4044

4145
__version__ = "2.5.0"
4246

0 commit comments

Comments
 (0)