Skip to content

Commit

Permalink
[pkg] Fix the custom 'setup.py build' under Py2
Browse files Browse the repository at this point in the history
With Python2, distutils' build_py command is an old-style class, which
doesn't support `super()`.
  • Loading branch information
rbarrois committed Sep 3, 2017
1 parent 4baa488 commit b40ab4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class BuildWithMakefile(build_py.build_py):
"""Custom 'build' command that runs 'make build' first."""
def run(self):
subprocess.check_call(['make', 'build'])
return super(BuildWithMakefile, self).run()
if sys.version_info[0] < 3:
# Under Python 2.x, build_py is an old-style class.
return build_py.build_py.run(self)
return super().run()


PACKAGE = 'django_xworkflows'
Expand Down

0 comments on commit b40ab4e

Please sign in to comment.