fix pylint error
This commit is contained in:
parent
eda2731702
commit
a9fccfd4ce
1 changed files with 9 additions and 1 deletions
|
@ -380,9 +380,17 @@ class LBRYFileUpload(resource.Resource):
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
shutil.copy(uploaded_file.name, newpath)
|
shutil.copy(uploaded_file.name, newpath)
|
||||||
# TODO Still need to remove the file
|
# TODO Still need to remove the file
|
||||||
|
|
||||||
|
# TODO deal with pylint error in cleaner fashion than this
|
||||||
|
try:
|
||||||
|
excp = WindowsError
|
||||||
|
except Exception as e:
|
||||||
|
log.error("This shouldn't happen")
|
||||||
|
excp = Exception
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.remove(uploaded_file.name)
|
os.remove(uploaded_file.name)
|
||||||
except WindowsError as e:
|
except excp as e:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
shutil.move(uploaded_file.name, newpath)
|
shutil.move(uploaded_file.name, newpath)
|
||||||
|
|
Loading…
Add table
Reference in a new issue