Skip to content

Commit fee62ca

Browse files
authored
Merge pull request pypa/distutils#344 from Sachaa-Thanasius/invalid-isinstance
Make sure `type(None)` is used instead of `None` for the type argument of `isinstance`.
2 parents 1d120d9 + 55ccc6a commit fee62ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

distutils/compilers/C/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ def _check_macro_definition(self, defn):
236236
def _is_valid_macro(name, value=None):
237237
"""
238238
A valid macro is a ``name : str`` and a ``value : str | None``.
239+
240+
>>> Compiler._is_valid_macro('foo', None)
241+
True
239242
"""
240-
return isinstance(name, str) and isinstance(value, (str, None))
243+
return isinstance(name, str) and isinstance(value, (str, type(None)))
241244

242245
# -- Bookkeeping methods -------------------------------------------
243246

0 commit comments

Comments
 (0)