diff options
author | steven.bethard <devnull@localhost> | 2009-09-12 16:08:15 +0000 |
---|---|---|
committer | steven.bethard <devnull@localhost> | 2009-09-12 16:08:15 +0000 |
commit | 660f1071cf765cdcebb6675a1ce5f0f925cbcb3a (patch) | |
tree | dedffe5f56111fd4b8d8831a1213e32f70b4c3ca /argparse.py | |
parent | 731583b6079d863789ee79bb60481b88c4165a74 (diff) | |
download | argparse-660f1071cf765cdcebb6675a1ce5f0f925cbcb3a.tar.gz |
Fix bug where classic classes were being rejected as type= arguments.
Diffstat (limited to 'argparse.py')
-rw-r--r-- | argparse.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/argparse.py b/argparse.py index cb77a4a..89d6f49 100644 --- a/argparse.py +++ b/argparse.py @@ -2125,8 +2125,9 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def _get_value(self, action, arg_string): type_func = self._registry_get('type', action.type, action.type) if not hasattr(type_func, '__call__'): - msg = _('%r is not callable') - raise ArgumentError(action, msg % type_func) + if not hasattr(type_func, '__bases__'): # classic classes + msg = _('%r is not callable') + raise ArgumentError(action, msg % type_func) # convert the value to the appropriate type try: |