From 5bac0516084aac41c49e7dfbbb7fc4f18c1382f4 Mon Sep 17 00:00:00 2001 From: ianb Date: Mon, 16 May 2005 03:20:15 +0000 Subject: Fixed expired .pyc file bug --- paste/tests/doctest_webapp.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paste/tests/doctest_webapp.py b/paste/tests/doctest_webapp.py index 43610f7..c13faa7 100755 --- a/paste/tests/doctest_webapp.py +++ b/paste/tests/doctest_webapp.py @@ -202,6 +202,14 @@ def append_to_file(path, version, data): f = open(path, 'a') f.write(data) f.close() + # I think these appends can happen so quickly (in less than a second) + # that the .pyc file doesn't appear to be expired, even though it + # is after we've made this change; so we have to get rid of the .pyc + # file: + if path.endswith('.py'): + pyc_file = path + 'c' + if os.path.exists(pyc_file): + os.unlink(pyc_file) show_file(path, version, description='added to %s' % path, data=data) -- cgit v1.2.1