GeezerVison is showing github.com — MAINT: Different workaround for old-style class. · wangtingpython/zipline@5a7bad4
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: setup.py +3-6Lines changed: 3 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -56,7 +56,8 @@ def __getitem__(self, key): |
56 | 56 |
|
57 | 57 | from Cython.Distutils import build_ext as cython_build_ext |
58 | 58 |
|
59 | | - class build_ext(cython_build_ext): |
| 59 | + # Cython_build_ext isn't a new-style class in Py2. |
| 60 | + class build_ext(cython_build_ext, object): |
60 | 61 | """ |
61 | 62 | Custom build_ext command that lazily adds numpy's include_dir to |
62 | 63 | extensions. |
@@ -73,11 +74,7 @@ def build_extensions(self): |
73 | 74 | for ext in self.extensions: |
74 | 75 | ext.include_dirs.append(numpy_incl) |
75 | 76 |
|
76 | | - # This explicitly calls the superclass method rather than the |
77 | | - # usual super() invocation because distutils' build_class, of |
78 | | - # which Cython's build_ext is a subclass, is an old-style class |
79 | | - # in Python 2, which doesn't support `super`. |
80 | | - cython_build_ext.build_extensions(self) |
| 77 | + super(build_ext, self).build_extensions() |
81 | 78 | return build_ext |
82 | 79 |
|
83 | 80 |
|
|