[pypy-svn] r41650 - pypy/build/buildtool

guido at codespeak.net guido at codespeak.net
Thu Mar 29 21:51:49 CEST 2007


Author: guido
Date: Thu Mar 29 21:51:48 2007
New Revision: 41650

Modified:
   pypy/build/buildtool/compile.py
Log:
Grmbl, another gateway I forgot to clean up... :(


Modified: pypy/build/buildtool/compile.py
==============================================================================
--- pypy/build/buildtool/compile.py	(original)
+++ pypy/build/buildtool/compile.py	Thu Mar 29 21:51:48 2007
@@ -170,39 +170,42 @@
     print config.compile_config
 
     msa = ServerAccessor(config)
-    print 'going to start compile'
-    ret = msa.start_compile(request)
-    reqid = ret['id']
-    path = ret['path']
-    message = ret['message']
-    if path:
-        print ('a suitable result is already available, you can '
-               'find it at "%s" on %s' % (path, config.server))
-    else:
-        print message
-        print 'the id of this build request is: %s' % (reqid,)
-        inprogress = True
-
-    if foreground and inprogress:
-        print 'waiting until it\'s done'
-        error = None
-        while 1:
-            ret = msa.check_in_progress()
-            if ret is not False:
-                error = ret
-                break
-            time.sleep(POLLTIME)
-        if error and error != 'None':
-            print 'error compiling:', error
-            return (False, error)
+    try:
+        print 'going to start compile'
+        ret = msa.start_compile(request)
+        reqid = ret['id']
+        path = ret['path']
+        message = ret['message']
+        if path:
+            print ('a suitable result is already available, you can '
+                   'find it at "%s" on %s' % (path, config.server))
         else:
-            print 'compilation finished successfully, downloading zip file'
-            zipfile = py.path.local('pypy-%s.zip' % (reqid,))
-            msa.save_zip(zipfile)
-            print 'done, the result can be found in %s' % (zipfile,)
-            return (True, message)
-    elif not foreground and inprogress and not path:
-        print 'you will be mailed once it\'s ready'
-    elif foreground:
-        return (False, message)
+            print message
+            print 'the id of this build request is: %s' % (reqid,)
+            inprogress = True
+
+        if foreground and inprogress:
+            print 'waiting until it\'s done'
+            error = None
+            while 1:
+                ret = msa.check_in_progress()
+                if ret is not False:
+                    error = ret
+                    break
+                time.sleep(POLLTIME)
+            if error and error != 'None':
+                print 'error compiling:', error
+                return (False, error)
+            else:
+                print 'compilation finished successfully, downloading zip file'
+                zipfile = py.path.local('pypy-%s.zip' % (reqid,))
+                msa.save_zip(zipfile)
+                print 'done, the result can be found in %s' % (zipfile,)
+                return (True, message)
+        elif not foreground and inprogress and not path:
+            print 'you will be mailed once it\'s ready'
+        elif foreground:
+            return (False, message)
+    finally:
+        msa.close()
 



More information about the Pypy-commit mailing list