summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-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)