diff --git a/lbrynet/lbrynet_daemon/LBRYDaemonServer.py b/lbrynet/lbrynet_daemon/LBRYDaemonServer.py index 775761b41..76af569c1 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemonServer.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemonServer.py @@ -380,9 +380,17 @@ class LBRYFileUpload(resource.Resource): if os.name == "nt": shutil.copy(uploaded_file.name, newpath) # 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: os.remove(uploaded_file.name) - except WindowsError as e: + except excp as e: pass else: shutil.move(uploaded_file.name, newpath)