# HG changeset patch # User Thierry Florac # Date 1426669724 -3600 # Node ID aa402a05ef0e5e18ad5c81d30a71a56dd45b823b # Parent 4070bf0c5d9e1844b702fa93fe049ff157974e59 Small optimization... diff -r 4070bf0c5d9e -r aa402a05ef0e src/pyams_file/file.py --- a/src/pyams_file/file.py Tue Mar 17 17:13:25 2015 +0100 +++ b/src/pyams_file/file.py Wed Mar 18 10:08:44 2015 +0100 @@ -237,10 +237,11 @@ raise ResumeCopy def _copy_blob(self, translate): - if self.context._blob is not None: + blob = self.context._blob + if blob is not None: target = translate(self.context) target._blob = Blob() - fsrc = self.context._blob.open('r') + fsrc = blob.open('r') fdst = target._blob.open('w') shutil.copyfileobj(fsrc, fdst) fdst.close()