diff --git a/0001-brain-py2gi-Silence-pygi-deprecation-warnings.patch b/0001-brain-py2gi-Silence-pygi-deprecation-warnings.patch new file mode 100644 index 0000000..6ce5f45 --- /dev/null +++ b/0001-brain-py2gi-Silence-pygi-deprecation-warnings.patch @@ -0,0 +1,49 @@ +From b9aef5ac624041f1427f61f7698a0b3f553b1d69 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Cole Robinson +Date: Fri, 27 Mar 2015 17:32:42 -0400 +Subject: [PATCH] brain: py2gi: Silence pygi deprecation warnings + +The way we inspect gi modules can trigger python-gobject deprecation +warnings. At least on Fedora 22 this is very noisy with a ton of +warnings right after running pylint on gi using code. + +Silence the specific pygi deprecation warnings. +--- + astroid/brain/py2gi.py | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/astroid/brain/py2gi.py b/astroid/brain/py2gi.py +index 6747898..8ff8c8f 100644 +--- a/astroid/brain/py2gi.py ++++ b/astroid/brain/py2gi.py +@@ -7,6 +7,7 @@ import inspect + import itertools + import sys + import re ++import warnings + + from astroid import MANAGER, AstroidBuildingException + from astroid.builder import AstroidBuilder +@@ -135,7 +136,17 @@ def _import_gi_module(modname): + for m in itertools.chain(modnames, optional_modnames): + try: + __import__(m) +- modcode += _gi_build_stub(sys.modules[m]) ++ with warnings.catch_warnings(): ++ # Just inspecting the code can raise gi deprecation ++ # warnings, so ignore them. ++ try: ++ from gi import PyGIDeprecationWarning ++ warnings.simplefilter("ignore", ++ PyGIDeprecationWarning) ++ except: ++ pass ++ ++ modcode += _gi_build_stub(sys.modules[m]) + except ImportError: + if m not in optional_modnames: + raise +-- +2.3.3 + diff --git a/python-astroid.spec b/python-astroid.spec index 9aaaebf..9764533 100644 --- a/python-astroid.spec +++ b/python-astroid.spec @@ -10,7 +10,7 @@ Name: python-astroid Version: 1.3.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python Abstract Syntax Tree New Generation Group: Development/Languages License: GPLv2+ @@ -18,6 +18,7 @@ URL: http://www.astroid.org Source0: https://bitbucket.org/logilab/astroid/get/astroid-%{version}.tar.bz2 Patch1: 0001-Fix-multiprocessing-on-py3.4.patch +Patch2: 0001-brain-py2gi-Silence-pygi-deprecation-warnings.patch Provides: python-astroid = %{version}-%{release} Obsoletes: python-logilab-astng <= 0.24.1 @@ -113,6 +114,10 @@ popd %endif # with_python3 %changelog +* Tue Jul 07 2015 Brian C. Lane 1.3.6-3 +- Fix for pygi deprecation warnings + https://bitbucket.org/logilab/astroid/issue/86 + * Thu Jun 18 2015 Fedora Release Engineering - 1.3.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild