diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-01-15 16:35:51 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-01-15 17:16:28 +0200 |
commit | d6911fb7f2514036c7c49d342561ca421a629cf4 (patch) | |
tree | a9ebf91ad0c5d30e4c4c07538317e51cf9a6f8f6 /obnamlib/bag_store.py | |
parent | 8630349a550fbed5dd52550920e5eecedc3fc146 (diff) | |
download | obnam-d6911fb7f2514036c7c49d342561ca421a629cf4.tar.gz |
Get EEXIST from errno, instead of exception
Diffstat (limited to 'obnamlib/bag_store.py')
-rw-r--r-- | obnamlib/bag_store.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/obnamlib/bag_store.py b/obnamlib/bag_store.py index b5ab4dde..cc58c3fd 100644 --- a/obnamlib/bag_store.py +++ b/obnamlib/bag_store.py @@ -16,6 +16,7 @@ # =*= License: GPL-3+ =*= +import errno import os import random @@ -113,7 +114,7 @@ class IdInventor(object): try: self._fs.write_file(filename, '') except OSError as e: # pragma: no cover - if e.errno == e.EEXIST: + if e.errno == errno.EEXIST: return False raise return True |