[Python-modules-commits] r28579 - in packages/astroid/trunk/debian (4 files)
morph at users.alioth.debian.org
morph at users.alioth.debian.org
Sat Apr 19 17:55:58 UTC 2014
Date: Saturday, April 19, 2014 @ 17:55:57
Author: morph
Revision: 28579
* debian/patches/bts744225-fix-gi-introspection-issues.patch
- fix GI introspection issues; thanks to Leo Iannacone for the report;
Closes: #744225
Added:
packages/astroid/trunk/debian/patches/
packages/astroid/trunk/debian/patches/bts744225-fix-gi-introspection-issues.patch
packages/astroid/trunk/debian/patches/series
Modified:
packages/astroid/trunk/debian/changelog
Modified: packages/astroid/trunk/debian/changelog
===================================================================
--- packages/astroid/trunk/debian/changelog 2014-04-19 07:39:50 UTC (rev 28578)
+++ packages/astroid/trunk/debian/changelog 2014-04-19 17:55:57 UTC (rev 28579)
@@ -3,8 +3,11 @@
* debian/copyright
- document test/data/SSL1/Connection1.py copyright, as pointed out by
Thorsten Alteholz
+ * debian/patches/bts744225-fix-gi-introspection-issues.patch
+ - fix GI introspection issues; thanks to Leo Iannacone for the report;
+ Closes: #744225
- -- Sandro Tosi <morph at debian.org> Sat, 04 Jan 2014 19:50:54 +0100
+ -- Sandro Tosi <morph at debian.org> Sat, 19 Apr 2014 19:54:00 +0200
astroid (1.0.1-1) unstable; urgency=low
Added: packages/astroid/trunk/debian/patches/bts744225-fix-gi-introspection-issues.patch
===================================================================
--- packages/astroid/trunk/debian/patches/bts744225-fix-gi-introspection-issues.patch (rev 0)
+++ packages/astroid/trunk/debian/patches/bts744225-fix-gi-introspection-issues.patch 2014-04-19 17:55:57 UTC (rev 28579)
@@ -0,0 +1,55 @@
+# HG changeset patch
+# User Sylvain Thénault <sylvain.thenault at logilab.fr>
+# Date 1396951874 -7200
+# Node ID fa1312a4d7aa8823f0dc5edf9f41ac9687ed7fa1
+# Parent 5e900cde9eb9c45f1472fa9c52e0d1900e978121
+backport gi related changes from pylint-brain, closes #19 and #22
+
+diff --git a/brain/py2gi.py b/brain/py2gi.py
+--- a/brain/py2gi.py
++++ b/brain/py2gi.py
+@@ -5,6 +5,7 @@
+
+ import inspect
+ import sys
++import re
+
+ from astroid import MANAGER, AstroidBuildingException
+ from astroid.builder import AstroidBuilder
+@@ -12,6 +13,7 @@
+
+ _inspected_modules = {}
+
++_identifier_re = r'^[A-Za-z_]\w*$'
+
+ def _gi_build_stub(parent):
+ """
+@@ -23,9 +25,13 @@
+ constants = {}
+ methods = {}
+ for name in dir(parent):
+- if not name or name.startswith("__"):
+- # GLib.IConv has a parameter named "" :/
++ if name.startswith("__"):
+ continue
++
++ # Check if this is a valid name in python
++ if not re.match(_identifier_re, name):
++ continue
++
+ try:
+ obj = getattr(parent, name)
+ except:
+@@ -46,6 +52,12 @@
+ str(obj).startswith("<GType ") or
+ inspect.isdatadescriptor(obj)):
+ constants[name] = 0
++ elif callable(obj):
++ # Fall back to a function for anything callable
++ functions[name] = obj
++ else:
++ # Assume everything else is some manner of constant
++ constants[name] = 0
+
+ ret = ""
+
Added: packages/astroid/trunk/debian/patches/series
===================================================================
--- packages/astroid/trunk/debian/patches/series (rev 0)
+++ packages/astroid/trunk/debian/patches/series 2014-04-19 17:55:57 UTC (rev 28579)
@@ -0,0 +1 @@
+bts744225-fix-gi-introspection-issues.patch
More information about the Python-modules-commits
mailing list