commit:     82341260d5d2f680253c73b3ff33ca965b9b84d3
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  3 03:14:50 2015 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Tue Feb  3 03:14:54 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=82341260

{config, reposconf}.py: Modifies import strategy for config parser

Importing the config parser based on hex version has been implemented
to ensure that layman is bringing in the correct config parse class.
For more information, see: https://bugs.gentoo.org/528752

---
 layman/config.py                             | 4 ++--
 layman/config_modules/reposconf/reposconf.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/layman/config.py b/layman/config.py
index 8ce0074..cc924f5 100644
--- a/layman/config.py
+++ b/layman/config.py
@@ -30,10 +30,10 @@ __version__ = "0.2"
 import sys
 import os
 
-try:
+if sys.hexversion >= 0x3000000:
     # Import for Python3
     import configparser as ConfigParser
-except:
+else:
     # Import for Python2
     import ConfigParser
 

diff --git a/layman/config_modules/reposconf/reposconf.py 
b/layman/config_modules/reposconf/reposconf.py
index 7336808..b0a323c 100644
--- a/layman/config_modules/reposconf/reposconf.py
+++ b/layman/config_modules/reposconf/reposconf.py
@@ -19,10 +19,10 @@ import os
 import subprocess
 import time
 
-try:
+if sys.hexversion >= 0x3000000:
     # Import for Python3
     import configparser as ConfigParser
-except:
+else:
     # Import for Python2
     import ConfigParser
 

Reply via email to