Skip to content

Commit f7d0758

Browse files
author
Lukasz Walach
committed
Use setuptools in favour of distutils.core
Fallback to distutils.core if setuptools aren't available
1 parent 3346597 commit f7d0758

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

postgresql/release/distutils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
import sys
1414
import os
1515
from ..project import version, name, identity as url
16-
from distutils.core import Extension, Command
16+
try:
17+
from setuptools import Extension, Command
18+
except ImportError as e:
19+
from distutils.core import Extension, Command
1720

1821
LONG_DESCRIPTION = """
1922
py-postgresql is a set of Python modules providing interfaces to various parts

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
sys.dont_write_bytecode = False
2626

2727
if __name__ == '__main__':
28-
from distutils.core import setup
28+
try:
29+
from setuptools import setup
30+
except ImportError as e:
31+
from distutils.core import setup
2932
setup(**defaults)

0 commit comments

Comments
 (0)