summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/compat.py5
-rw-r--r--pyramid/config/util.py7
2 files changed, 6 insertions, 6 deletions
diff --git a/pyramid/compat.py b/pyramid/compat.py
index bfa345b88..5909debf2 100644
--- a/pyramid/compat.py
+++ b/pyramid/compat.py
@@ -244,3 +244,8 @@ else:
def is_bound_method(ob):
return inspect.ismethod(ob) and getattr(ob, im_self, None) is not None
+# support annotations and keyword-only arguments in PY3
+if PY3:
+ from inspect import getfullargspec as getargspec
+else:
+ from inspect import getargspec
diff --git a/pyramid/config/util.py b/pyramid/config/util.py
index b91f3f7ab..23cdc6be8 100644
--- a/pyramid/config/util.py
+++ b/pyramid/config/util.py
@@ -3,6 +3,7 @@ import inspect
from pyramid.compat import (
bytes_,
+ getargspec,
is_nonstr_iter,
)
@@ -22,12 +23,6 @@ ActionInfo = ActionInfo # support bw compat imports
MAX_ORDER = 1 << 30
DEFAULT_PHASH = md5().hexdigest()
-# support annotations and keyword-only arguments in PY3
-try:
- getargspec = inspect.getfullargspec
-except AttributeError:
- getargspec = inspect.getargspec
-
def as_sorted_tuple(val):
if not is_nonstr_iter(val):
val = (val,)