diff options
author | Fred Drake <fdrake@acm.org> | 2001-01-08 15:39:32 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-01-08 15:39:32 +0000 |
commit | 2fe986bdb29b7c6b589cbf82efba0a891a3485a3 (patch) | |
tree | fa2ed09c71fe2c862d4341f854284f71fb0e17d8 /Lib/getopt.py | |
parent | 815a887ede9b7657cb92c5de78521a527aee31b5 (diff) | |
download | cpython-2fe986bdb29b7c6b589cbf82efba0a891a3485a3.tar.gz |
GetoptError is always initialized with exactly two parameters, so simplify
the constructor.
Diffstat (limited to 'Lib/getopt.py')
-rw-r--r-- | Lib/getopt.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/getopt.py b/Lib/getopt.py index a8ad645bee..1bc42bd6a6 100644 --- a/Lib/getopt.py +++ b/Lib/getopt.py @@ -20,13 +20,10 @@ option involved with the exception. class GetoptError(Exception): opt = '' msg = '' - def __init__(self, *args): - self.args = args - if len(args) == 1: - self.msg = args[0] - elif len(args) == 2: - self.msg = args[0] - self.opt = args[1] + def __init__(self, msg, opt): + self.msg = msg + self.opt = opt + Exception.__init__(self, msg, opt) def __str__(self): return self.msg |