From c4c7de9f244bc7cbeebdf63e08535b80782e599b Mon Sep 17 00:00:00 2001 From: keceli Date: Fri, 4 Oct 2013 01:56:41 -0400 Subject: [PATCH] rmgpy/qm/mopac.py: Wait for 1 sec for the buffer to write to disc. Temporary solution to avoid attribute errors from cclib during parsing. See issue #134 --- rmgpy/qm/mopac.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rmgpy/qm/mopac.py b/rmgpy/qm/mopac.py index 76280d676cb..2cd261ba679 100644 --- a/rmgpy/qm/mopac.py +++ b/rmgpy/qm/mopac.py @@ -139,7 +139,8 @@ def run(self): stdout, stderr = process.communicate(input=command) # necessary to wait for executable termination! if b"ended normally" not in stderr.strip(): logging.warning("Mopac error message:" + stderr.decode('utf-8')) - + import time + time.sleep(1) # copy output file from temp dir to output dir: tempOutFile = os.path.join(dirpath, os.path.basename(self.output_file_path)) shutil.copy(tempOutFile, self.output_file_path)