diff --git a/src/python/gem5/utils/filelock.py b/src/python/gem5/utils/filelock.py index 82e1122bf9..a6798e9f53 100644 --- a/src/python/gem5/utils/filelock.py +++ b/src/python/gem5/utils/filelock.py @@ -69,12 +69,22 @@ class FileLock(object): except OSError as e: if e.errno != errno.EEXIST: raise + solution_message = ( + "This is likely due to the existence" + " of the lock file '{}'. If there's no other process" + " the lock file, you can manually delete the lock file and" + " rerun the script.".format(self.lockfile) + ) if self.timeout is None: raise FileLockException( - "Could not acquire lock on {}".format(self.file_name) + "Could not acquire lock on {}. {}".format( + self.file_name, solution_message + ) ) if (time.time() - start_time) >= self.timeout: - raise FileLockException("Timeout occured.") + raise FileLockException( + "Timeout occured. {}".format(solution_message) + ) time.sleep(self.delay) # self.is_locked = True