diff options
author | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-03-14 01:46:27 -0700 |
---|---|---|
committer | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-03-14 10:27:06 -0700 |
commit | 7abad68565a6adfbbb619400e186d58aef038d28 (patch) | |
tree | 7df06fb99ad0bd754de58e8016241b1b6b1f0bd8 | |
parent | 62e88770e6aee08ad0ead04d44769aa59bb5785b (diff) | |
download | pycrypto-win-build-wip.tar.gz |
Use setuptools when available so that we can use bdist_eggwin-build-wip
-rw-r--r-- | setup.py | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -36,19 +36,24 @@ __revision__ = "$Id$" +import sys +if sys.version[0:1] == '1': + raise RuntimeError ("The Python Cryptography Toolkit requires " + "Python 2.x or 3.x to build.") + from distutils import core from distutils.ccompiler import new_compiler -from distutils.core import Extension, Command from distutils.command.build import build from distutils.command.build_ext import build_ext +try: + from setuptools import Command, Extension, setup +except ImportError: + from distutils.core import Command, Extension, setup import distutils.sysconfig -import os, sys, re +import os +import re import struct -if sys.version[0:1] == '1': - raise RuntimeError ("The Python Cryptography Toolkit requires " - "Python 2.x or 3.x to build.") - if sys.platform == 'win32': HTONS_LIBS = ['ws2_32'] plat_ext = [ @@ -481,7 +486,7 @@ if hasattr(core, 'setup_keywords'): 'Programming Language :: Python :: 3', ] -core.setup(**kw) +setup(**kw) def touch(path): import os, time @@ -498,4 +503,4 @@ if (sys.platform == 'win32' and sys.version_info[0] == 3 and 'build' in sys.argv[1:]): PrintErr("\nSecond pass to allow 2to3 to fix nt.py. No cause for alarm.\n") touch("./lib/Crypto/Random/OSRNG/nt.py") - core.setup(**kw) + setup(**kw) |