mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-03 12:40:47 +08:00
MAINT: Different workaround for old-style class.
This commit is contained in:
committed by
Richard Frank
parent
5f49fa22cb
commit
5a7bad4005
@@ -56,7 +56,8 @@ class LazyBuildExtCommandClass(dict):
|
||||
|
||||
from Cython.Distutils import build_ext as cython_build_ext
|
||||
|
||||
class build_ext(cython_build_ext):
|
||||
# Cython_build_ext isn't a new-style class in Py2.
|
||||
class build_ext(cython_build_ext, object):
|
||||
"""
|
||||
Custom build_ext command that lazily adds numpy's include_dir to
|
||||
extensions.
|
||||
@@ -73,11 +74,7 @@ class LazyBuildExtCommandClass(dict):
|
||||
for ext in self.extensions:
|
||||
ext.include_dirs.append(numpy_incl)
|
||||
|
||||
# This explicitly calls the superclass method rather than the
|
||||
# usual super() invocation because distutils' build_class, of
|
||||
# which Cython's build_ext is a subclass, is an old-style class
|
||||
# in Python 2, which doesn't support `super`.
|
||||
cython_build_ext.build_extensions(self)
|
||||
super(build_ext, self).build_extensions()
|
||||
return build_ext
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user