diff options
| author | saarni <saarni@gmail.com> | 2015-02-05 12:14:21 +0200 |
|---|---|---|
| committer | saarni <saarni@gmail.com> | 2015-02-05 12:14:21 +0200 |
| commit | 561591252bd029981952c5c229f4cf27832d34a1 (patch) | |
| tree | 78877c81f6f297c7c80c01b1434a4fc260f9a839 | |
| parent | 620bdefbff81792fd047f273a234264ce3d0a764 (diff) | |
| download | pyramid-561591252bd029981952c5c229f4cf27832d34a1.tar.gz pyramid-561591252bd029981952c5c229f4cf27832d34a1.tar.bz2 pyramid-561591252bd029981952c5c229f4cf27832d34a1.zip | |
use getfullargspec in PY3, allowing annotations in subscribers
| -rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
| -rw-r--r-- | pyramid/config/util.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e4132cda5..adf2224a5 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -238,3 +238,5 @@ Contributors - Hugo Branquinho, 2014/11/25 - Adrian Teng, 2014/12/17 + +- Ilja Everila, 2015/02/05 diff --git a/pyramid/config/util.py b/pyramid/config/util.py index 892592196..b91f3f7ab 100644 --- a/pyramid/config/util.py +++ b/pyramid/config/util.py @@ -22,6 +22,12 @@ 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,) @@ -201,7 +207,7 @@ def takes_one_arg(callee, attr=None, argname=None): return False try: - argspec = inspect.getargspec(fn) + argspec = getargspec(fn) except TypeError: return False |
