From 9529fa26dcc318668c7372665e9945a31dd6e0d3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Sep 2014 21:18:39 +0530 Subject: [PATCH] Retry when watch-compiling coffeescript --- setup/resources.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup/resources.py b/setup/resources.py index d7805f8d31..ac1d5990af 100644 --- a/setup/resources.py +++ b/setup/resources.py @@ -62,8 +62,13 @@ class Coffee(Command): # {{{ '*.coffee')): bn = os.path.basename(f).rpartition('.')[0] arcname = src.replace('/', '.') + '.' + bn + '.js' - with open(f, 'rb') as fs: - src_files[arcname] = (f, hashlib.sha1(fs.read()).hexdigest()) + try: + with open(f, 'rb') as fs: + src_files[arcname] = (f, hashlib.sha1(fs.read()).hexdigest()) + except EnvironmentError: + time.sleep(0.1) + with open(f, 'rb') as fs: + src_files[arcname] = (f, hashlib.sha1(fs.read()).hexdigest()) existing = {} dest = self.j(self.RESOURCES, 'compiled_coffeescript.zip')