summaryrefslogtreecommitdiff
path: root/python/qpid/spec010.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-03-04 20:23:38 +0000
committerRafael H. Schloming <rhs@apache.org>2008-03-04 20:23:38 +0000
commitcf9a1617599bb680deef2bab76fc6022f7dad50b (patch)
tree9692afac5d2b5b1c3043601ec66332b8211950d7 /python/qpid/spec010.py
parent75f598b22ea4573cff2d47fdd689b85cee5dd88d (diff)
downloadqpid-python-cf9a1617599bb680deef2bab76fc6022f7dad50b.tar.gz
check the mtime of the cached spec against the code that generates it
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@633623 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/spec010.py')
-rw-r--r--python/qpid/spec010.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/python/qpid/spec010.py b/python/qpid/spec010.py
index 2d8bd6050d..e6b7946e17 100644
--- a/python/qpid/spec010.py
+++ b/python/qpid/spec010.py
@@ -17,8 +17,9 @@
# under the License.
#
-import datatypes
+import os, cPickle, datatypes
from codec010 import StringCodec
+from util import mtime
class Node:
@@ -598,11 +599,9 @@ class Loader:
def do_exception(self, e):
return Exception(id(e["@name"]), id(e["@error-code"]), self.children(e))
-import os, cPickle
-
def load(xml):
fname = xml + ".pcl"
- if os.path.exists(fname):
+ if os.path.exists(fname) and mtime(fname) > mtime(__file__):
file = open(fname, "r")
s = cPickle.load(file)
file.close()