diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-11-17 17:40:57 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-11-17 17:40:57 +0000 |
commit | 496b4c3ec2bf9fadc5d59f44f98fa45ea199e1f2 (patch) | |
tree | 55b278eb2002f384df367bde2e960a0f733800f5 | |
parent | e1bac223c54f8f0c3c41e026623eab209dd3f095 (diff) | |
download | obnam-496b4c3ec2bf9fadc5d59f44f98fa45ea199e1f2.tar.gz |
Fill in empty _data using a template dict
-rw-r--r-- | obnamlib/fmt_ga/indexes.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/obnamlib/fmt_ga/indexes.py b/obnamlib/fmt_ga/indexes.py index 9985061e..0e05fd03 100644 --- a/obnamlib/fmt_ga/indexes.py +++ b/obnamlib/fmt_ga/indexes.py @@ -78,8 +78,11 @@ class GAChunkIndexes(object): self._data_is_loaded = True def _prepare_data(self): - if 'index' not in self._data: - self._data['index'] = [] + if len(self._data) == 0: + empty = { + 'index': [], + } + self._data = empty.copy() def find_chunk_ids_by_content(self, chunk_content): self._load_data() |