summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-03-14 01:46:27 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-03-14 10:27:06 -0700
commit7abad68565a6adfbbb619400e186d58aef038d28 (patch)
tree7df06fb99ad0bd754de58e8016241b1b6b1f0bd8
parent62e88770e6aee08ad0ead04d44769aa59bb5785b (diff)
downloadpycrypto-win-build-wip.tar.gz
Use setuptools when available so that we can use bdist_eggwin-build-wip
-rw-r--r--setup.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 1c54b6c..b5ce9f6 100644
--- a/setup.py
+++ b/setup.py
@@ -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)