Skip to content

Commit c621b66

Browse files
committed
in clear() clear journals and node files.
AFAICT clear() is never called by current codebase, but this fixes a flake8 issue where the loop variable (renamed to data_type) was unused within loop. Also this triggerd a look at Database.clear() in rdbms_common.py which was not clearing the journals.
1 parent 2172652 commit c621b66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/backends/back_anydbm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ def clear(self):
239239
"""
240240
logging.getLogger('roundup.hyperdb.backend').info('clear')
241241
for cn in self.classes:
242-
for dummy in 'nodes', 'journals':
243-
path = os.path.join(self.dir, 'journals.%s' % cn)
242+
for data_type in 'nodes', 'journals':
243+
path = os.path.join(self.dir, '%s.%s' % (data_type, cn))
244244
if os.path.exists(path):
245245
os.remove(path)
246246
elif os.path.exists(path+'.db'): # dbm appends .db

0 commit comments

Comments
 (0)