Skip to content

Commit

Permalink
Don't suppress errors from failed library loads.
Browse files Browse the repository at this point in the history
  • Loading branch information
nneonneo committed Apr 16, 2014
1 parent 3e804a4 commit fe9fb14
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 2048.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
MULTITHREAD = True

for suffix in ['so', 'dll', 'dylib']:
try:
ailib = ctypes.CDLL('bin/2048.' + suffix)
break
except OSError as e:
pass
dllfn = 'bin/2048.' + suffix
if not os.path.isfile(dllfn):
continue
ailib = ctypes.CDLL(dllfn)
break
else:
print("Couldn't load 2048 library bin/2048.{so,dll,dylib}! Make sure to build it first.")
print("Couldn't find 2048 library bin/2048.{so,dll,dylib}! Make sure to build it first.")
exit()

ailib.init_tables()
Expand Down

0 comments on commit fe9fb14

Please sign in to comment.