Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't use ImportError to check python version in setup.py #50

Merged
merged 1 commit into from

2 participants

@oscarbenjamin

The check for ImportError with build_py_2to3 fails to correctly detect the python version in some cases (I found this when installing opster automatically as a dependency another package in a virtualenv). This patch explicitly checks the python version rather than relying on ImportError.

@piranha piranha merged commit 7bb9c95 into piranha:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 11, 2012
  1. @oscarbenjamin
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 4 deletions.
  1. +3 −4 setup.py
View
7 setup.py
@@ -1,14 +1,13 @@
#!/usr/bin/env python
-import os, re
+import sys, os, re
from distutils.core import setup
# Use 2to3 build conversion if required
-try:
+if sys.version_info >= (3, 0):
from distutils.command.build_py import build_py_2to3 as build_py
-except ImportError:
- # 2.x
+else:
from distutils.command.build_py import build_py
def read(fname):
Something went wrong with that request. Please try again.