Gentoo Archives: gentoo-commits

From: Devan Franchini <twitch153@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/layman:master commit in: layman/config_modules/reposconf/, layman/
Date: Tue, 03 Feb 2015 03:17:05
Message-Id: 1422933294.82341260d5d2f680253c73b3ff33ca965b9b84d3.twitch153@gentoo
1 commit: 82341260d5d2f680253c73b3ff33ca965b9b84d3
2 Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 3 03:14:50 2015 +0000
4 Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 3 03:14:54 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=82341260
7
8 {config, reposconf}.py: Modifies import strategy for config parser
9
10 Importing the config parser based on hex version has been implemented
11 to ensure that layman is bringing in the correct config parse class.
12 For more information, see: https://bugs.gentoo.org/528752
13
14 ---
15 layman/config.py | 4 ++--
16 layman/config_modules/reposconf/reposconf.py | 4 ++--
17 2 files changed, 4 insertions(+), 4 deletions(-)
18
19 diff --git a/layman/config.py b/layman/config.py
20 index 8ce0074..cc924f5 100644
21 --- a/layman/config.py
22 +++ b/layman/config.py
23 @@ -30,10 +30,10 @@ __version__ = "0.2"
24 import sys
25 import os
26
27 -try:
28 +if sys.hexversion >= 0x3000000:
29 # Import for Python3
30 import configparser as ConfigParser
31 -except:
32 +else:
33 # Import for Python2
34 import ConfigParser
35
36
37 diff --git a/layman/config_modules/reposconf/reposconf.py b/layman/config_modules/reposconf/reposconf.py
38 index 7336808..b0a323c 100644
39 --- a/layman/config_modules/reposconf/reposconf.py
40 +++ b/layman/config_modules/reposconf/reposconf.py
41 @@ -19,10 +19,10 @@ import os
42 import subprocess
43 import time
44
45 -try:
46 +if sys.hexversion >= 0x3000000:
47 # Import for Python3
48 import configparser as ConfigParser
49 -except:
50 +else:
51 # Import for Python2
52 import ConfigParser