[pypy-svn] r29500 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Thu Jun 29 18:31:35 CEST 2006


Author: arigo
Date: Thu Jun 29 18:31:34 2006
New Revision: 29500

Modified:
   pypy/dist/pypy/rpython/llinterp.py
Log:
Make a symlink '/tmp/usession-<username>/llinterp_trace.html' pointing to the
latest (or currently) produced .html.


Modified: pypy/dist/pypy/rpython/llinterp.py
==============================================================================
--- pypy/dist/pypy/rpython/llinterp.py	(original)
+++ pypy/dist/pypy/rpython/llinterp.py	Thu Jun 29 18:31:34 2006
@@ -4,7 +4,7 @@
 from pypy.rpython.ootypesystem import ootype
 from pypy.rpython.objectmodel import ComputedIntSymbolic
 
-import sys
+import sys, os
 import math
 import py
 import traceback, cStringIO
@@ -869,8 +869,20 @@
         from pypy.tool.udir import udir
         n = Tracer.Counter
         Tracer.Counter += 1
-        self.file = udir.join('llinterp_trace_%d.html' % n).open('w')
+        filename = 'llinterp_trace_%d.html' % n
+        self.file = udir.join(filename).open('w')
         print >> self.file, self.HEADER
+
+        linkname = str(udir.join('llinterp_trace.html'))
+        try:
+            os.unlink(linkname)
+        except OSError:
+            pass
+        try:
+            os.symlink(filename, linkname)
+        except (AttributeError, OSError):
+            pass
+
         self.count = 0
         self.indentation = ''
 



More information about the Pypy-commit mailing list