Skip to content

Commit 90bc1cf

Browse files
Make sure type(None) is used instead of None for the type argument of isinstance.
Using None, whether alone or in a tuple, as the second argument raises a TypeError.
1 parent b53777a commit 90bc1cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

distutils/compilers/C/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _is_valid_macro(name, value=None):
237237
"""
238238
A valid macro is a ``name : str`` and a ``value : str | None``.
239239
"""
240-
return isinstance(name, str) and isinstance(value, (str, None))
240+
return isinstance(name, str) and isinstance(value, (str, type(None)))
241241

242242
# -- Bookkeeping methods -------------------------------------------
243243

0 commit comments

Comments
 (0)