summaryrefslogtreecommitdiff
path: root/argparse.py
diff options
context:
space:
mode:
authorsteven.bethard <devnull@localhost>2009-09-12 16:08:15 +0000
committersteven.bethard <devnull@localhost>2009-09-12 16:08:15 +0000
commit660f1071cf765cdcebb6675a1ce5f0f925cbcb3a (patch)
treededffe5f56111fd4b8d8831a1213e32f70b4c3ca /argparse.py
parent731583b6079d863789ee79bb60481b88c4165a74 (diff)
downloadargparse-660f1071cf765cdcebb6675a1ce5f0f925cbcb3a.tar.gz
Fix bug where classic classes were being rejected as type= arguments.
Diffstat (limited to 'argparse.py')
-rw-r--r--argparse.py5
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: