From c5f1dc543bc9dfba0ae1dd5eaf695695559cb9e1 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Fri, 25 May 2012 15:01:33 +0200 Subject: [PATCH] Code cleanup. --- patoolib/util.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/patoolib/util.py b/patoolib/util.py index e25e3ce..48e8db9 100644 --- a/patoolib/util.py +++ b/patoolib/util.py @@ -359,14 +359,11 @@ def stripext (filename): def get_single_outfile (directory, archive, extension=""): """Get output filename if archive is in a single file format like gzip.""" outfile = os.path.join(directory, stripext(archive)) - if is_same_filename(archive, outfile): - # prevent overwriting the archive itself - extension = ".raw" - if os.path.exists(outfile+extension): + if os.path.exists(outfile + extension): # prevent overwriting existing files i = 1 newfile = "%s%d" % (outfile, i) - while os.path.exists(newfile+extension): + while os.path.exists(newfile + extension): newfile = "%s%d" % (outfile, i) i += 1 outfile = newfile