summaryrefslogtreecommitdiff
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-01-29 16:50:40 -0500
committerYury Selivanov <yselivanov@sprymix.com>2014-01-29 16:50:40 -0500
commit7d3804bdad1b5b0a2a43e8da893f13fae6389d74 (patch)
tree568c13cdc4af16f33d1cd680f88c17d7adcb7f8b /Lib/inspect.py
parentc160359a01c81376b42c0f325d7b2a6cb64d6dd1 (diff)
downloadcpython-7d3804bdad1b5b0a2a43e8da893f13fae6389d74.tar.gz
inspect.Signature.from_function: Use CO_VARARGS & CO_VARKEYWORDS constants
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 3ad4a825dc..e6c7b5b634 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -2109,7 +2109,7 @@ class Signature:
default=defaults[offset]))
# *args
- if func_code.co_flags & 0x04:
+ if func_code.co_flags & CO_VARARGS:
name = arg_names[pos_count + keyword_only_count]
annotation = annotations.get(name, _empty)
parameters.append(Parameter(name, annotation=annotation,
@@ -2126,9 +2126,9 @@ class Signature:
kind=_KEYWORD_ONLY,
default=default))
# **kwargs
- if func_code.co_flags & 0x08:
+ if func_code.co_flags & CO_VARKEYWORDS:
index = pos_count + keyword_only_count
- if func_code.co_flags & 0x04:
+ if func_code.co_flags & CO_VARARGS:
index += 1
name = arg_names[index]