summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index e2dee0f..73b3f6b 100644
--- a/setup.py
+++ b/setup.py
@@ -3,22 +3,19 @@
import os
import sys
-try:
- import setuptools
-except ImportError:
- from distribute_setup import use_setuptools
- use_setuptools()
-from setuptools import setup, Extension
+import distutils.errors
+import setuptools
if not hasattr(sys, "hexversion") or sys.hexversion < 0x02040000:
- raise Error("Python 2.4 or newer is required")
+ raise distutils.errors.DistutilsError("Python 2.4 or newer is required")
if os.name == "posix":
from setup_posix import get_config
-else: # assume windows
+else: # assume windows
from setup_windows import get_config
metadata, options = get_config()
-metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)]
+metadata['ext_modules'] = [
+ setuptools.Extension(sources=['_mysql.c'], **options)]
metadata['long_description'] = metadata['long_description'].replace(r'\n', '')
-setup(**metadata)
+setuptools.setup(**metadata)