preliminary coding to make gkeyldap py3 capable
authorBrian Dolbec <dolsen@gentoo.org>
Sun, 10 Nov 2013 07:45:16 +0000 (23:45 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Fri, 15 Nov 2013 09:12:36 +0000 (01:12 -0800)
gkeyldap/search.py
gkeys/config.py

index 92471dfab2ae75cb3fd131736aeb13a729b80f27..2cbc4b95743bffb9cee631ada144f87e43bbb032 100644 (file)
@@ -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
index fe78dec2c34a57f2244442ddfa5c9b92679d5aca..5b220a821517c5dd0593190ff2be61e8d9308c63 100644 (file)
 """
 
 import os
-import ConfigParser
+import sys
+
+# py3.2
+if sys.hexversion >= 0x30200f0:
+    import configparser as ConfigParser
+else:
+    import ConfigParser
+
 from collections import namedtuple