Skip to content

Commit b219349

Browse files
authored
Merge pull request #49 from realpython/jim/fix_concurrency_2
use hasattr instead of getattr with test
2 parents 68d9d40 + 0fc6da5 commit b219349

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

concurrency-overview/io_threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
def get_session():
12-
if not getattr(thread_local, "session", None):
12+
if not hasattr(thread_local, "session"):
1313
thread_local.session = requests.Session()
1414
return thread_local.session
1515

0 commit comments

Comments
 (0)