# Clean up if we're the last job for dir; for multi-file dirs,
# it's possible for more than one job to run cleanup at once, so
# don't fail if things are already clean.
- if os.listdir(dir) == ['using-tags']:
+ ld = os.listdir(dir)
+ if ld == ['using-tags'] or sorted(ld) == ['cover.front', 'using-tags']:
try:
+ os.unlink(dir + '/cover.front')
os.unlink(dir + '/using-tags')
os.rmdir(dir)
except EnvironmentError: