From c6f3fb5e9f5ddd8470f13ff855cc3398131c6ca1bf02c36228422eac7154a122 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Thu, 17 Sep 2015 11:51:45 +0000
Subject: [PATCH] Accepting request 331682 from
home:M0ses:branches:devel:languages:python
Added patch to import gi module and added to changes file
OBS-URL: https://build.opensuse.org/request/show/331682
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-keyring?expand=0&rev=38
---
keyring-import-gi.patch | 12 ++++++++++++
python-keyring.changes | 6 ++++++
python-keyring.spec | 4 +++-
3 files changed, 21 insertions(+), 1 deletion(-)
create mode 100644 keyring-import-gi.patch
diff --git a/keyring-import-gi.patch b/keyring-import-gi.patch
new file mode 100644
index 0000000..321baa4
--- /dev/null
+++ b/keyring-import-gi.patch
@@ -0,0 +1,12 @@
+diff --git a/keyring/backends/Gnome.py b/keyring/backends/Gnome.py
+index 7a8a274..642bc80 100644
+--- a/keyring/backends/Gnome.py
++++ b/keyring/backends/Gnome.py
+@@ -3,6 +3,7 @@ import os
+ try:
+ from gi import Repository
+ if Repository.get_default().enumerate_versions('GnomeKeyring'):
++ import gi
+ gi.require_version('GnomeKeyring', '1.0')
+ from gi.repository import GnomeKeyring
+ except ImportError:
diff --git a/python-keyring.changes b/python-keyring.changes
index 3476f82..4faaa21 100644
--- a/python-keyring.changes
+++ b/python-keyring.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Mon Sep 17 11:41:56 UTC 2015 - m0ses@samaxi.de
+
+- Added keyring-import-gi.patch: gi.require_version is called and not
+ found if gi is not imported
+
-------------------------------------------------------------------
Mon Sep 7 08:40:56 UTC 2015 - dimstar@opensuse.org
diff --git a/python-keyring.spec b/python-keyring.spec
index b547fb2..9ea36cd 100644
--- a/python-keyring.spec
+++ b/python-keyring.spec
@@ -1,7 +1,7 @@
#
# spec file for package python-keyring
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,7 @@ Group: Development/Languages/Python
Source: https://pypi.python.org/packages/source/k/keyring/keyring-%{version}.tar.gz
# PATCH-FIX-UPSTREAM keyring-gnome-3.18.patch dimstar@opensuse.org -- Silence a warning when run in GNOME 3.18: gi requires versioned imports now.
Patch0: keyring-gnome-3.18.patch
+Patch1: keyring-import-gi.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-setuptools
@@ -57,6 +58,7 @@ from python. It can be used in any application that needs safe password storage.
%prep
%setup -q -n keyring-%{version}
%patch0 -p1
+%patch1 -p1
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' keyring/cli.py keyring/backends/_win_crypto.py