diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-01-11 04:56:53 -0800 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-01-11 04:56:53 -0800 |
commit | 73f93130e3a49a81e500e80749ad61a2f78744cd (patch) | |
tree | ad3aa046f9e25d45baf261639b9c143756abd0fc | |
parent | dc513fa80322ae17f4e275e398ca331de14df8f2 (diff) | |
parent | 2b1e0bd1965f859783ac9cf2c5752b971900ecdd (diff) | |
download | pyopenssl-73f93130e3a49a81e500e80749ad61a2f78744cd.tar.gz |
Merge pull request #4 from pyca/tox
Add tox and travis-ci configuration to aid proper testing.
-rw-r--r-- | .travis.yml | 15 | ||||
-rw-r--r-- | OpenSSL/crypto.py | 4 | ||||
-rw-r--r-- | memdbg.py | 6 | ||||
-rwxr-xr-x | setup.py | 6 | ||||
-rw-r--r-- | tox.ini | 10 |
5 files changed, 34 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..659677a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: python + +os: + - linux + - osx + +python: + - "pypy" + - "2.6" + - "2.7" + - "3.2" + - "3.3" + +script: + - python setup.py test diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py index 0c78b31..c2180d0 100644 --- a/OpenSSL/crypto.py +++ b/OpenSSL/crypto.py @@ -1926,10 +1926,10 @@ class _PassphraseHelper(object): try: _exception_from_error_queue(exceptionType) except exceptionType as e: - pass + from_queue = e if self._problems: raise self._problems[0] - return e + return from_queue def _read_passphrase(self, buf, size, rwflag, userdata): @@ -31,7 +31,7 @@ verbose = False def log(s): if verbose: - print s + print(s) def _backtrace(): buf = _ffi.new("void*[]", 64) @@ -75,8 +75,8 @@ def free(p): if _api.CRYPTO_set_mem_functions(malloc, realloc, free): - print 'Enabled memory debugging' + log('Enabled memory debugging') heap = {} else: - print 'Failed to enable memory debugging' + log('Failed to enable memory debugging') heap = None @@ -8,7 +8,7 @@ Installation script for the OpenSSL module """ -from distutils.core import setup +from setuptools import setup # XXX Deduplicate this __version__ = '0.13' @@ -34,6 +34,7 @@ setup(name='pyOpenSSL', version=__version__, maintainer_email = 'exarkun@twistedmatrix.com', url = 'https://github.com/pyca/pyopenssl', license = 'APL2', + install_requires=["cryptography>=0.1"], long_description = """\ High-level wrapper around a subset of the OpenSSL library, includes * SSL.Connection objects, wrapping the methods of Python's portable @@ -58,4 +59,5 @@ High-level wrapper around a subset of the OpenSSL library, includes 'Topic :: Security :: Cryptography', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', - ]) + ], + test_suite="OpenSSL.test") @@ -0,0 +1,10 @@ +[tox] +envlist = pypy,py26,py27,py32,py33 + +[testenv] +setenv = + # Do not allowed the executing environment to pollute the test environment + # with extra packages. + PYTHONPATH= +# The standard library unittest module can run tests on Python 2.7 and newer +commands = python setup.py test |