From 4ef11137892a897d8ad00d39e028987e053090b6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 23 May 2016 00:00:59 -0700 Subject: [PATCH] Fix case which could incorrectly clear the data from the file. --- etgtools/item_module_map.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etgtools/item_module_map.py b/etgtools/item_module_map.py index 13afc47d..9936fb54 100644 --- a/etgtools/item_module_map.py +++ b/etgtools/item_module_map.py @@ -68,6 +68,8 @@ class ItemModuleMap(object): def flush(self): + if not self._haveReadData and not self._items: + return with textfile_open(self.fileName, 'wt') as fid: # Dump the data to a file in json, using a format that minimizes # excess whitespace. @@ -86,7 +88,6 @@ class ItemModuleMap(object): def get_fullname(self, name): module = self.items.get(name) if not module: - import mydbstub return name return module + name