diff --git a/0002-Check-for-flags-enum-types-before-checking-for-int.patch b/0002-Check-for-flags-enum-types-before-checking-for-int.patch new file mode 100644 index 0000000..47037c9 --- /dev/null +++ b/0002-Check-for-flags-enum-types-before-checking-for-int.patch @@ -0,0 +1,34 @@ +From b0fdfe55e8428f3a9a141f70632607d6bf0d9bb2 Mon Sep 17 00:00:00 2001 +From: David Shea +Date: Fri, 11 Dec 2015 15:04:21 -0500 +Subject: [PATCH] Check for flags/enum types before checking for int + +gobject-introspection enum and flag types inherit from int, so the check +for a unusable string represenation needs to happen before checking if +the values can be used as integers. This fixes syntax errors in the +generated stubs for gobject-introspection modules containing flag and +enum types. +--- + astroid/brain/brain_gi.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/astroid/brain/brain_gi.py b/astroid/brain/brain_gi.py +index d2c133d..62b013c 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(" 1.4.1-2 +- Check for flags/enum types before checking for int + Upstream PR https://github.com/PyCQA/astroid/pull/287 + * Thu Dec 10 2015 Brian C. Lane 1.4.1-1 - Upstream 1.4.1 - Drop included patches