From 31e4924465304f8b01b8c04b22085bf24f40096e Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Thu, 5 Feb 2015 22:36:59 -0600 Subject: move getargspec import into pyramid.compat --- pyramid/compat.py | 5 +++++ pyramid/config/util.py | 7 +------ 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,) -- cgit v1.2.3