summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/cli/__init__.py6
-rw-r--r--pykolab/wap_client/__init__.py5
-rw-r--r--wallace/__init__.py5
3 files changed, 13 insertions, 3 deletions
diff --git a/pykolab/cli/__init__.py b/pykolab/cli/__init__.py
index 3aafd03..2b3c511 100644
--- a/pykolab/cli/__init__.py
+++ b/pykolab/cli/__init__.py
@@ -16,7 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-
+try:
+ # Python 2: "reload" is built-in
+ reload
+except NameError:
+ from importlib import reload
import ldap
import ldif
import logging
diff --git a/pykolab/wap_client/__init__.py b/pykolab/wap_client/__init__.py
index f8427c0..176ac91 100644
--- a/pykolab/wap_client/__init__.py
+++ b/pykolab/wap_client/__init__.py
@@ -1,6 +1,9 @@
import json
-import httplib
+try:
+ import httplib
+except ImportError:
+ import http.client as httplib
import urllib
import sys
try:
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 4f73ac6..6f11b01 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -31,7 +31,10 @@ import socket
import struct
import sys
import tempfile
-from threading import _Timer
+try:
+ from threading import _Timer
+except:
+ from threading import Timer as _Timer
import time
import pykolab