[pypy-svn] r63708 - pypy/trunk/pypy/rlib

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Apr 6 11:41:21 CEST 2009


Author: cfbolz
Date: Mon Apr  6 11:41:20 2009
New Revision: 63708

Modified:
   pypy/trunk/pypy/rlib/rzlib.py
Log:
Raise an import error if zlib is not installed


Modified: pypy/trunk/pypy/rlib/rzlib.py
==============================================================================
--- pypy/trunk/pypy/rlib/rzlib.py	(original)
+++ pypy/trunk/pypy/rlib/rzlib.py	Mon Apr  6 11:41:20 2009
@@ -2,7 +2,7 @@
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.translator.platform import platform as compiler
+from pypy.translator.platform import platform as compiler, CompilationError
 
 if compiler.name == "msvc":
     libname = 'zlib'
@@ -12,11 +12,12 @@
         libraries=[libname],
         includes=['zlib.h']
     )
-eci = rffi_platform.configure_external_library(
-    libname, eci,
-    [dict(prefix='zlib-'),
-     ])
-if not eci:
+try:
+    eci = rffi_platform.configure_external_library(
+        libname, eci,
+        [dict(prefix='zlib-'),
+         ])
+except CompilationError:
     raise ImportError("Could not find a zlib library")
 
 



More information about the Pypy-commit mailing list