From: Brian Dolbec Date: Sun, 10 Nov 2013 07:45:16 +0000 (-0800) Subject: preliminary coding to make gkeyldap py3 capable X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a998ae25de96cd4e11be48f639dead56886d9a8f;p=gentoo-keys.git preliminary coding to make gkeyldap py3 capable --- diff --git a/gkeyldap/search.py b/gkeyldap/search.py index 92471df..2cbc4b9 100644 --- a/gkeyldap/search.py +++ b/gkeyldap/search.py @@ -2,7 +2,17 @@ #-*- coding:utf-8 -*- -import ldap +try: + import ldap +except ImportError: + import sys + # py3.2 + if sys.hexversion >= 0x30200f0: + print('To run "ldap-seeds" in python 3, it requires a python3 ' + 'compatible version of dev-python/python-ldap be installed') + print('Currently only dev-python/python-ldap-9999 has that capability') + raise + from gkeys import log from gkeys.config import GKEY diff --git a/gkeys/config.py b/gkeys/config.py index fe78dec..5b220a8 100644 --- a/gkeys/config.py +++ b/gkeys/config.py @@ -11,7 +11,14 @@ """ import os -import ConfigParser +import sys + +# py3.2 +if sys.hexversion >= 0x30200f0: + import configparser as ConfigParser +else: + import ConfigParser + from collections import namedtuple