Skip to content

Commit

Permalink
Suppress error if preference checkforrecoveries is undefined.
Browse files Browse the repository at this point in the history
It appears this preference is not always defined, like on certain
Linux distributions or installation on Windows using a classkit
license. See issue #39. We just suppress the error as the whole
point is to not have recovery files anyway, seeing as how they might
use up all disk space when many simulations are run back to back.
  • Loading branch information
john-hen committed May 22, 2021
1 parent 2ac0d13 commit 2f665b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mph/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ def __init__(self, cores=None, version=None, port=None, host='localhost'):
java.setPreference('updates.update.check', 'off')
java.setPreference('tempfiles.saving.warnifoverwriteolder', 'off')
java.setPreference('tempfiles.recovery.autosave', 'off')
java.setPreference('tempfiles.recovery.checkforrecoveries', 'off')
try:
# Preference not defined on certain systems, see issue #39.
java.setPreference('tempfiles.recovery.checkforrecoveries', 'off')
except Exception:
logger.debug('Could not turn off check for recovery files.')
java.setPreference('tempfiles.saving.optimize', 'filesize')

# Save useful information in instance attributes.
Expand Down

0 comments on commit 2f665b4

Please sign in to comment.