Address errors, improvements, formatting
- Removed unused code not portable due to buffer() use - raw_input() does not exist in Python 3 - Fixed octal constant syntax for Python 3 - Fixed TypeError - Replace if not exists: makedirs(path) with single call: using makedirs(path, exist_ok=True) - Class inherits from object, can be safely removed from bases in python3: pylint's useless-object-inheritance (W0235) check Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
@@ -452,7 +452,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
|
||||
logger.debug('read and verify with taglist %r', taglist)
|
||||
# FIXME: choose a dir on the same disk/dir as the final path
|
||||
fd, tmppath = tempfile.mkstemp(suffix='.whipper.wav')
|
||||
os.fchmod(fd, 0644)
|
||||
os.fchmod(fd, 0o644)
|
||||
os.close(fd)
|
||||
self._tmpwavpath = tmppath
|
||||
|
||||
|
||||
@@ -151,8 +151,7 @@ class ReadTOCTask(task.Task):
|
||||
t_comp = os.path.abspath(self.toc_path).split(os.sep)
|
||||
t_dirn = os.sep.join(t_comp[:-1])
|
||||
# If the output path doesn't exist, make it recursively
|
||||
if not os.path.isdir(t_dirn):
|
||||
os.makedirs(t_dirn)
|
||||
os.makedirs(t_dirn, exist_ok=True)
|
||||
t_dst = truncate_filename(
|
||||
os.path.join(t_dirn, t_comp[-1] + '.toc'))
|
||||
shutil.copy(self.tocfile, os.path.join(t_dirn, t_dst))
|
||||
|
||||
Reference in New Issue
Block a user