summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-06-23 18:18:20 -0400
committerMonty Taylor <mordred@inaugust.com>2013-06-23 18:18:20 -0400
commitbd95bd9d9c915a7779e0409c4daf9cc740cff439 (patch)
treebe3ac4429eb2fc7cb35d4d7f780627800a37ccab
parent0d1dd6fa894d50ce9bec0f059d60321930ad5277 (diff)
downloadmysqldb1-bd95bd9d9c915a7779e0409c4daf9cc740cff439.tar.gz
Replace raise Error with distutils exception.
Distutils has an exceptions heirarchy. Use it.
-rw-r--r--setup.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index e6dd995..73b3f6b 100644
--- a/setup.py
+++ b/setup.py
@@ -3,17 +3,19 @@
import os
import sys
-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)