summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandro Locati <fabio@locati.cc>2016-01-13 21:01:15 +0100
committerFabio Alessandro Locati <fabio@locati.cc>2016-01-13 21:01:15 +0100
commit0892768c1ac835c17e4555507fa9538c6fb3af7a (patch)
treec977789e5fa4d8f2aa88fcc716cfec7d4e026239
parent3e981a41624a5a71124abb6cfbe61c577a91b775 (diff)
downloadrsa-0892768c1ac835c17e4555507fa9538c6fb3af7a.tar.gz
Fix FTBFS import error
-rw-r--r--rsa/_version133.py6
-rw-r--r--tests/constants.py2
-rw-r--r--tests/test_strings.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/rsa/_version133.py b/rsa/_version133.py
index dff0dda..386baa0 100644
--- a/rsa/_version133.py
+++ b/rsa/_version133.py
@@ -34,7 +34,11 @@ __version__ = '1.3.3'
# NOTE: Python's modulo can return negative numbers. We compensate for
# this behaviour using the abs() function
-from cPickle import dumps, loads
+try:
+ import cPickle as pickle
+except:
+ import pickle
+from pickle import dumps, loads
import base64
import math
import os
diff --git a/tests/constants.py b/tests/constants.py
index 5eab9f2..6c4f84a 100644
--- a/tests/constants.py
+++ b/tests/constants.py
@@ -17,7 +17,7 @@
from rsa._compat import have_python3
if have_python3:
- from py3kconstants import *
+ from tests.py3kconstants import *
else:
from py2kconstants import *
diff --git a/tests/test_strings.py b/tests/test_strings.py
index fe60055..7d4dc87 100644
--- a/tests/test_strings.py
+++ b/tests/test_strings.py
@@ -22,7 +22,7 @@ import unittest2
import rsa
-from constants import unicode_string
+from tests.constants import unicode_string
class StringTest(unittest2.TestCase):