summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-12-11 22:58:49 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-12-11 22:58:49 +0200
commitd4d1842ed2c3b51de80869ad0b423f11b1937987 (patch)
tree653117c0df9bc866878eedcd6129e0bf5512c4e9
parent7f4ce0ece9eda79e7a098abbf4ed3c982450f9a1 (diff)
parentb0fdfe55e8428f3a9a141f70632607d6bf0d9bb2 (diff)
downloadastroid-git-d4d1842ed2c3b51de80869ad0b423f11b1937987.tar.gz
Merge pull request #287 from dashea/gi-stub-enum
Check for flags/enum types before checking for int
-rw-r--r--astroid/brain/brain_gi.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/astroid/brain/brain_gi.py b/astroid/brain/brain_gi.py
index d2c133d3..62b013c3 100644
--- a/astroid/brain/brain_gi.py
+++ b/astroid/brain/brain_gi.py
@@ -47,13 +47,13 @@ def _gi_build_stub(parent):
elif (inspect.ismethod(obj) or
inspect.ismethoddescriptor(obj)):
methods[name] = obj
- elif isinstance(obj, (int, str)):
- constants[name] = obj
elif (str(obj).startswith("<flags") or
str(obj).startswith("<enum ") or
str(obj).startswith("<GType ") or
inspect.isdatadescriptor(obj)):
constants[name] = 0
+ elif isinstance(obj, (int, str)):
+ constants[name] = obj
elif callable(obj):
# Fall back to a function for anything callable
functions[name] = obj