diff options
author | Robert Collins <robertc@robertcollins.net> | 2012-12-29 08:51:01 +1300 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2012-12-29 08:51:01 +1300 |
commit | 7d08b37c65bda29411c0ef2ba938f38b26eb5f96 (patch) | |
tree | 4844f218f5e92b631fdfdea51cc11bb760140cb9 | |
parent | 56f5c349b874f75263b7f0dd304574a4322ea231 (diff) | |
download | testrepository-7d08b37c65bda29411c0ef2ba938f38b26eb5f96.tar.gz |
* Fix another incompatability with Mac OS X - gdbm dbm modules don't support
get. (Robert Collins, #1094330)
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | testrepository/repository/file.py | 6 |
2 files changed, 11 insertions, 1 deletions
@@ -5,6 +5,12 @@ testrepository release notes NEXT (In development) +++++++++++++++++++++ +IMPROVEMENTS +------------ + +* Fix another incompatability with Mac OS X - gdbm dbm modules don't support + get. (Robert Collins, #1094330) + 0.0.10 ++++++ diff --git a/testrepository/repository/file.py b/testrepository/repository/file.py index 6f92c97..72fcef2 100644 --- a/testrepository/repository/file.py +++ b/testrepository/repository/file.py @@ -144,7 +144,11 @@ class Repository(AbstractRepository): for test_id in test_ids: if type(test_id) != str: test_id = test_id.encode('utf8') - duration = db.get(test_id, None) + # gdbm does not support get(). + try: + duration = db[test_id] + except KeyError: + duration = None if duration is not None: result[test_id] = float(duration) return result |