diff options
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index ef888f063b..9a67b41ae0 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1361,6 +1361,10 @@ class _ActionsContainer(object): if not callable(type_func): raise ValueError('%r is not callable' % (type_func,)) + if type_func is FileType: + raise ValueError('%r is a FileType class object, instance of it' + ' must be passed' % (type_func,)) + # raise an error if the metavar does not match the type if hasattr(self, "_get_formatter"): try: |