Skip to content

Commit

Permalink
Merge pull request #79 from mnaberez/explain-typeerror-from-use-errno
Browse files Browse the repository at this point in the history
Add comment to explain why use_errno may cause TypeError
  • Loading branch information
davelopez01 committed Jan 19, 2015
2 parents 31cc3b3 + 5c44364 commit 815e6d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/LabJackPython.py
Expand Up @@ -89,7 +89,7 @@ def _loadLinuxSo():
"""
try:
l = ctypes.CDLL("liblabjackusb.so", use_errno=True)
except TypeError:
except TypeError: # Python 2.5
l = ctypes.CDLL("liblabjackusb.so")
l.LJUSB_Stream.errcheck = errcheck
l.LJUSB_Read.errcheck = errcheck
Expand All @@ -101,7 +101,7 @@ def _loadMacDylib():
"""
try:
l = ctypes.CDLL("liblabjackusb.dylib", use_errno=True)
except TypeError:
except TypeError: # Python 2.5
l = ctypes.CDLL("liblabjackusb.dylib")
l.LJUSB_Stream.errcheck = errcheck
l.LJUSB_Read.errcheck = errcheck
Expand Down
4 changes: 2 additions & 2 deletions src/u12.py
Expand Up @@ -346,7 +346,7 @@ def errcheck(ret, func, args):
def _loadLinuxSo():
try:
l = ctypes.CDLL("liblabjackusb.so", use_errno=True)
except TypeError:
except TypeError: # Python 2.5
l = ctypes.CDLL("liblabjackusb.so")
l.LJUSB_Stream.errcheck = errcheck
l.LJUSB_Read.errcheck = errcheck
Expand All @@ -355,7 +355,7 @@ def _loadLinuxSo():
def _loadMacDylib():
try:
l = ctypes.CDLL("liblabjackusb.dylib", use_errno=True)
except TypeError:
except TypeError: # Python 2.5
l = ctypes.CDLL("liblabjackusb.dylib")
l.LJUSB_Stream.errcheck = errcheck
l.LJUSB_Read.errcheck = errcheck
Expand Down

0 comments on commit 815e6d1

Please sign in to comment.