Skip to content
Browse files

Remove the .bak file after writing

  • Loading branch information...
1 parent 6ab81f7 commit 0b9f2ac879e66d9bc55a1c42d5121761962ba2ba @akkana committed Sep 24, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 epubtag.py
View
4 epubtag.py
@@ -110,9 +110,11 @@ def tag_epub_file(filename, new_tag_list=None, delete_tags=False) :
# Now we have the new file in new_epub_file, old in filename.
# Rename appropriately:
- os.rename(filename, filename + ".bak")
+ bakfile = filename + ".bak"
+ os.rename(filename, bakfile)
os.rename(new_epub_file, filename)
print "Wrote", filename
+ os.remove(bakfile)
def Usage() :
print "Usage: %s file.epub [file.epub...] [-d] [-t tag1 [tag2...]]" \

0 comments on commit 0b9f2ac

Please sign in to comment.
Something went wrong with that request. Please try again.