diff --git a/distutils/cmd.py b/distutils/cmd.py index 241621bd..8593d6fd 100644 --- a/distutils/cmd.py +++ b/distutils/cmd.py @@ -107,7 +107,7 @@ def __init__(self, dist: Distribution) -> None: # timestamps, but methods defined *here* assume that # 'self.force' exists for all commands. So define it here # just to be safe. - self.force = None + self.force: bool | None = None # The 'help' flag is just used for command-line parsing, so # none of that complicated bureaucracy is needed. diff --git a/distutils/command/build_ext.py b/distutils/command/build_ext.py index ec45b440..716b07a8 100644 --- a/distutils/command/build_ext.py +++ b/distutils/command/build_ext.py @@ -125,7 +125,7 @@ def initialize_options(self): self.rpath = None self.link_objects = None self.debug = None - self.force = None + self.force: bool = None # Should always be set in finalize_options self.compiler = None self.swig = None self.swig_cpp = None diff --git a/distutils/compilers/C/base.py b/distutils/compilers/C/base.py index 93385e13..6412dc34 100644 --- a/distutils/compilers/C/base.py +++ b/distutils/compilers/C/base.py @@ -70,7 +70,7 @@ class Compiler: # dictionary (see below -- used by the 'new_compiler()' factory # function) -- authors of new compiler interface classes are # responsible for updating 'compiler_class'! - compiler_type: ClassVar[str] = None # type: ignore[assignment] + compiler_type: ClassVar[str] = None # XXX things not handled by this compiler abstraction model: # * client can't provide additional options for a compiler,