Skip to content

Commit 731453e

Browse files
committed
Avoid useless './' in file paths
Replaced useless 'os.path.relpath(os.getcwd())' statement with 'os.curdir' (which is equal to '.'). Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
1 parent 078d351 commit 731453e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

whipper/command/cd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def add_arguments(self):
280280
"supports this feature. ")
281281
self.parser.add_argument('-O', '--output-directory',
282282
action="store", dest="output_directory",
283-
default=os.path.relpath(os.getcwd()),
283+
default=os.curdir,
284284
help="output directory; will be included "
285285
"in file paths in log")
286286
self.parser.add_argument('-W', '--working-directory',

whipper/common/program.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ def getPath(self, outdir, template, mbdiscid, metadata, track_number=None):
239239
# Avoid filtering non str type values, replace None with empty string
240240
v_fltr = {k: self._filter.filter(v2) if isinstance(v2, str) else ''
241241
if v2 is None else v2 for k, v2 in v.items()}
242+
if outdir == os.curdir:
243+
return template % v_fltr # Avoid useless './' in file paths
242244
return os.path.join(outdir, template % v_fltr)
243245

244246
@staticmethod

0 commit comments

Comments
 (0)