Commits

Armin Rigo committed a8661e4

Fix according to stmimpl.rst.

Comments (0)

Files changed (3)

hack/bin/py.cleanup

                     pass
         elif (filename.endswith('.pyc') or filename.endswith('.pyo') or
               filename.endswith('.pyc~') or filename.endswith('.pyo~')):
-            os.unlink(filename)
-            count += 1
+            try:
+                os.unlink(filename)
+                count += 1
+            except OSError, e:
+                print >> sys.stderr, e
 
 count = 0
 

hack/misc/startup.py

 
 startup()
 del startup
+
+try:
+    del __file__
+except NameError:
+    pass

hack/stm/python/c2.py

 
     def PossiblyUpdateChain(self, G, R, R_Container, FieldName):
         if G is not R and random.random() < 0.1:
-            # compress the chain
-            while True:
-                G_next = self.h_revision(G)
-                if G_next is R:
-                    break
-                self.set_h_revision(G, R)
-                G = G_next
+            # compress the chain one step (cannot compress the whole chain!)
+            self.set_h_revision(G, R)
             # update the original field
             if R_Container is not None:
                 assert FieldName in R_Container._fields