mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-14 18:12:35 +08:00
Replace raise Error with distutils exception.
Distutils has an exceptions heirarchy. Use it.
This commit is contained in:
12
setup.py
12
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)
|
||||
|
Reference in New Issue
Block a user