Skip to content

Commit e14b2bc

Browse files
committed
flake8 fixes. use except ImportError; use callable() not hasattr(x, '__call__')
1 parent d6b2636 commit e14b2bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/anypy/findargspec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Python 3+
99
from inspect import getfullargspec as getargspec
1010
findargspec = getargspec
11-
except:
11+
except ImportError:
1212
# Python 2.5-2.7 modified from https://bugs.python.org/issue20828
1313
import inspect
1414

@@ -17,7 +17,7 @@ def findargspec(fn):
1717
inspectable = fn
1818
elif inspect.isclass(fn):
1919
inspectable = fn.__init__
20-
elif hasattr(fn, '__call__'):
20+
elif callable(fn):
2121
inspectable = fn.__call__
2222
else:
2323
inspectable = fn

0 commit comments

Comments
 (0)