Skip to content

Commit

Permalink
Avoid python 3.10 feature
Browse files Browse the repository at this point in the history
The "name" attribute for NameError is new in python 3.10, it seems.
  • Loading branch information
mara004 committed Dec 14, 2023
1 parent 3edc46e commit bc2c843
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ctypesgen/libraryloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def _find_library(name, dirs, search_sys, reldir=None):
if reldir is None:
try:
reldir = pathlib.Path(__file__).parent
except NameError as e:
assert e.name == "__file__"
except NameError:
reldir = None

for dir in dirs:
Expand Down

0 comments on commit bc2c843

Please sign in to comment.