diff options
author | steven.bethard <devnull@localhost> | 2009-06-14 21:32:28 +0000 |
---|---|---|
committer | steven.bethard <devnull@localhost> | 2009-06-14 21:32:28 +0000 |
commit | d77688d99d8ce50420fe5ac5e0a2df012ef25a55 (patch) | |
tree | c1972016959c3e7b6f0ed64be0319d0d81107141 /argparse.py | |
parent | da2a4da94bdb285c7b568e4fd0e546577e446f33 (diff) | |
download | argparse-d77688d99d8ce50420fe5ac5e0a2df012ef25a55.tar.gz |
Allow None as the first argument to ArgumentError.
Diffstat (limited to 'argparse.py')
-rw-r--r-- | argparse.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/argparse.py b/argparse.py index 8544dd7..449a617 100644 --- a/argparse.py +++ b/argparse.py @@ -589,7 +589,9 @@ class RawTextHelpFormatter(RawDescriptionHelpFormatter): # =====================
def _get_action_name(argument):
- if argument.option_strings:
+ if argument is None:
+ return None
+ elif argument.option_strings:
return '/'.join(argument.option_strings)
elif argument.metavar not in (None, SUPPRESS):
return argument.metavar
|