Skip to content

Commit

Permalink
simplify ctypes' type check
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Jul 1, 2021
1 parent fd0800a commit 0c6725f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/cppyy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ def sizeof(tt):
try:
return _sizes[tt]
except KeyError:
if type(tt).__module__[:7] == '_ctypes':
try:
sz = ctypes.sizeof(tt)
else:
except TypeError:
sz = gbl.gInterpreter.ProcessLine("sizeof(%s);" % (_get_name(tt),))
_sizes[tt] = sz
return sz
Expand Down

0 comments on commit 0c6725f

Please sign in to comment.