summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-02-05 22:36:59 -0600
committerMichael Merickel <michael@merickel.org>2015-02-05 22:36:59 -0600
commit31e4924465304f8b01b8c04b22085bf24f40096e (patch)
tree640e048c6b5306865c8ab0d6ae2ac89c16f3b14c
parente82a99ee9a69504af88c84f39f325d25baae9fe6 (diff)
downloadpyramid-31e4924465304f8b01b8c04b22085bf24f40096e.tar.gz
pyramid-31e4924465304f8b01b8c04b22085bf24f40096e.tar.bz2
pyramid-31e4924465304f8b01b8c04b22085bf24f40096e.zip
move getargspec import into pyramid.compat
-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,)