Skip to content

Commit ec65f34

Browse files
author
Doug Ollerenshaw
committed
change if statement to try/except
1 parent bc4e9d2 commit ec65f34

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

allensdk/core/typing.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import sys
2-
if sys.version_info.minor <= 7:
2+
try:
3+
# for Python 3.8 and greater
4+
from typing import Protocol
5+
except ImportError:
6+
# for Python 3.7 and before
37
from typing import _Protocol as Protocol
48
else:
5-
from typing import Protocol
9+
610
from abc import abstractmethod
711

812

0 commit comments

Comments
 (0)