Skip to content

Commit cf31798

Browse files
committed
Allow empty name if handle is non-null in CDLL
1 parent 4a151ca commit cf31798

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/ctypes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def __init__(self, name, mode=DEFAULT_MODE, handle=None,
443443
else:
444444
import nt
445445
mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
446-
if '/' in name or '\\' in name:
446+
if name is not None and ('/' in name or '\\' in name):
447447
self._name = nt._getfullpathname(self._name)
448448
mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
449449

0 commit comments

Comments
 (0)