Skip to content

Commit 0fc6da5

Browse files
committed
use hasattr instead of getattr with test
1 parent 68d9d40 commit 0fc6da5

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)