Replace bare exception from getfullargspec

getfullargspec is based on signature, which is documented to
raise TypeError and ValueError.

Related to https://github.com/capnproto/pycapnp/issues/254
This commit is contained in:
John Vandenberg
2021-06-01 15:42:17 +08:00
parent 0f6df849cd
commit a20e69dbe9

View File

@@ -1974,7 +1974,7 @@ cdef class _Promise:
argspec = None
try:
argspec = _inspect.getfullargspec(func)
except:
except (TypeError, ValueError):
pass
if argspec:
args_length = len(argspec.args) if argspec.args else 0
@@ -2042,7 +2042,7 @@ cdef class _VoidPromise:
argspec = None
try:
argspec = _inspect.getfullargspec(func)
except:
except (TypeError, ValueError):
pass
if argspec:
args_length = len(argspec.args) if argspec.args else 0
@@ -2146,7 +2146,7 @@ cdef class _RemotePromise:
argspec = None
try:
argspec = _inspect.getfullargspec(func)
except:
except (TypeError, ValueError):
pass
if argspec:
args_length = len(argspec.args) if argspec.args else 0