Skip to content

Commit 5c89cc7

Browse files
committed
fix old setuptools copatibility
1 parent 376e72d commit 5c89cc7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

setuptools_rust/patch.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from distutils.dist import Distribution
22
from distutils.command.build import build as Build
33
from setuptools.command import develop
4-
from setuptools.command.py36compat import sdist_add_defaults
4+
5+
try:
6+
from setuptools.command.py36compat import sdist_add_defaults
7+
has_py36compat = True
8+
except ImportError:
9+
has_py36compat = False
510

611

712
# allow to use 'rust_extensions' parameter for setup() call
@@ -49,4 +54,5 @@ def _add_defaults_ext(self):
4954
self.filelist.extend(build_ext.get_source_files())
5055

5156

52-
sdist_add_defaults._add_defaults_ext = _add_defaults_ext
57+
if has_py36compat:
58+
sdist_add_defaults._add_defaults_ext = _add_defaults_ext

0 commit comments

Comments
 (0)