From: Andrew M. Kuchling Date: Thu, 6 Feb 2003 19:52:56 +0000 (+0000) Subject: A few naughty external scripts do 'raise getopt.error, "blah"', and X-Git-Tag: v2.3c1~1990 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01892664561cab9ff9ae62c4595137d22c39ac6c;p=python A few naughty external scripts do 'raise getopt.error, "blah"', and now crash because two arguments are expected. Add a default value to keep those scripts running. --- diff --git a/Lib/getopt.py b/Lib/getopt.py index 4285cbb284..04e881ec73 100644 --- a/Lib/getopt.py +++ b/Lib/getopt.py @@ -39,7 +39,7 @@ import os class GetoptError(Exception): opt = '' msg = '' - def __init__(self, msg, opt): + def __init__(self, msg, opt=''): self.msg = msg self.opt = opt Exception.__init__(self, msg, opt)