Skip to content


Subversion checkout URL

You can clone with
Download ZIP


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

merged 1 commit into from

2 participants


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
@@ -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
+if sys.version_info >= (3, 0):
from distutils.command.build_py import build_py_2to3 as build_py
-except ImportError:
- # 2.x
from distutils.command.build_py import build_py
def read(fname):
Something went wrong with that request. Please try again.