From 0892768c1ac835c17e4555507fa9538c6fb3af7a Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Wed, 13 Jan 2016 21:01:15 +0100 Subject: Fix FTBFS import error --- rsa/_version133.py | 6 +++++- tests/constants.py | 2 +- tests/test_strings.py | 2 +- 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): -- cgit v1.2.1