diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-06 15:17:50 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-06 15:17:50 +0000 |
| commit | 7b8c5c892a642553cd375f8180eff25c7406b865 (patch) | |
| tree | 8786be27b55af16c92daf421637acaa1e4bd10f7 /scripts | |
| parent | c3e4f97d87207bd0df5cb93007a83a97bba0064d (diff) | |
catch exception if the file doesnt exist
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/historyplacement.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/historyplacement.py b/scripts/historyplacement.py index 815b31cb..6ce5dff5 100644 --- a/scripts/historyplacement.py +++ b/scripts/historyplacement.py @@ -60,9 +60,9 @@ class _state: def _load(data): global _data - file = open(os.environ['HOME']+'/.openbox/'+FILENAME+"."+str(data.screen), - 'r') - if file: + try: + file = open(os.environ['HOME'] + '/.openbox/' + FILENAME+"." + + str(data.screen), 'r') # read data for line in file.readlines(): line = line[:-1] # drop the '\n' @@ -78,6 +78,7 @@ def _load(data): except ValueError: pass except IndexError: pass file.close() + except IOError: pass def _save(data): global _data |
