Anonymous avatar Anonymous committed 94ae5ec Merge

Merge.

Comments (0)

Files changed (1)

+import os.path
 
+import distutils.errors
 from distutils.core import setup
 from distutils.extension import Extension
 from distutils.log import warn
     cmdclass = dict(build_ext=build_ext)
     line_profiler_source = '_line_profiler.pyx'
 except ImportError, e:
-    warn("Could not import Cython. Using pre-generated C file if available.")
     cmdclass = {}
     line_profiler_source = '_line_profiler.c'
+    if not os.path.exists(line_profiler_source):
+        raise distutils.errors.DistutilsError("""\
+You need cython to build the line_profiler from a mercurial checkout, or
+alternatively use a release tarball from PyPI to build it without cython.""")
+    else:
+        warn("Could not import Cython. Using pre-generated C file if available.")
 
 long_description = """\
 line_profiler will profile the time individual lines of code take to execute.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.