summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/cmd.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-04-10 13:11:51 (GMT)
committerGreg Ward <gward@python.net>2000-04-10 13:11:51 (GMT)
commitd197a3a12c851b59d48df1eda22cad0a570a6bd3 (patch)
tree30cfb30de88b7014bd9035e04e51b02e01192c23 /Lib/distutils/cmd.py
parent5f8b12f27e1cce4ff7e5fd3594a83855db350784 (diff)
downloadcpython-d197a3a12c851b59d48df1eda22cad0a570a6bd3.zip
cpython-d197a3a12c851b59d48df1eda22cad0a570a6bd3.tar.gz
cpython-d197a3a12c851b59d48df1eda22cad0a570a6bd3.tar.bz2
Define 'self.force' in the constructor and remove the hack in '__getattr__()'
to account for it not being defined in the constructor.
Diffstat (limited to 'Lib/distutils/cmd.py')
-rw-r--r--Lib/distutils/cmd.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
index 16008c4..b3d1664 100644
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -59,6 +59,12 @@ class Command:
self._verbose = None
self._dry_run = None
+ # Some commands define a 'self.force' option to ignore file
+ # timestamps, but methods defined *here* assume that
+ # 'self.force' exists for all commands. So define it here
+ # just to be safe.
+ self.force = None
+
# The 'help' flag is just used for command-line parsing, so
# none of that complicated bureaucracy is needed.
self.help = 0
@@ -79,11 +85,6 @@ class Command:
return getattr (self.distribution, attr)
else:
return myval
-
- # Needed because some Command methods assume 'self.force' exists,
- # but not all commands define 'self.force'. Ugh.
- elif attr == 'force':
- return None
else:
raise AttributeError, attr