mirror of
https://github.com/9001/copyparty.git
synced 2025-10-02 14:42:28 -06:00
more ruff check fixes
This commit is contained in:
parent
506a448a19
commit
9a07d1dd80
|
@ -2,7 +2,6 @@
|
|||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import argparse
|
||||
import traceback
|
||||
|
||||
from queue import Queue
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ class HttpSrv(object):
|
|||
self.log(self.name, "accept({}): {}".format(fno, ex), c=6)
|
||||
time.sleep(0.02)
|
||||
continue
|
||||
except TypeError as ex:
|
||||
except TypeError:
|
||||
# on macOS, accept() may return a None saddr if blocked by LittleSnitch;
|
||||
# unicode(saddr[0]) ==> TypeError: 'NoneType' object is not subscriptable
|
||||
if tcp and not saddr:
|
||||
|
|
|
@ -10,7 +10,7 @@ import subprocess as sp
|
|||
import sys
|
||||
import tempfile
|
||||
|
||||
from .__init__ import ANYWIN, EXE, PY2, WINDOWS, E, unicode
|
||||
from .__init__ import ANYWIN, EXE, PY2, WINDOWS, unicode
|
||||
from .authsrv import VFS
|
||||
from .bos import bos
|
||||
from .util import (
|
||||
|
|
|
@ -15,7 +15,6 @@ try:
|
|||
raise Exception()
|
||||
|
||||
HAVE_ARGON2 = True
|
||||
from argon2 import exceptions as argon2ex
|
||||
except:
|
||||
HAVE_ARGON2 = False
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import errno
|
|||
import re
|
||||
import select
|
||||
import socket
|
||||
import time
|
||||
|
||||
from .__init__ import TYPE_CHECKING
|
||||
from .multicast import MC_Sck, MCast
|
||||
|
|
|
@ -8,7 +8,7 @@ from itertools import chain
|
|||
from .bimap import Bimap, BimapError
|
||||
from .bit import get_bits, set_bits
|
||||
from .buffer import BufferError
|
||||
from .label import DNSBuffer, DNSLabel, set_avahi_379
|
||||
from .label import DNSBuffer, DNSLabel
|
||||
from .ranges import IP4, IP6, H, I, check_bytes
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import ctypes
|
|||
from ctypes import wintypes
|
||||
|
||||
if True: # pylint: disable=using-constant-test
|
||||
from typing import Iterable, List
|
||||
from typing import Iterable
|
||||
|
||||
from . import _shared as shared
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ if True: # pylint: disable=using-constant-test
|
|||
import typing
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from .__init__ import ANYWIN, EXE, MACOS, PY2, TYPE_CHECKING, E, EnvParams, unicode
|
||||
from .__init__ import ANYWIN, EXE, MACOS, PY2, TYPE_CHECKING, EnvParams, unicode
|
||||
from .authsrv import BAD_CFG, AuthSrv
|
||||
from .bos import bos
|
||||
from .cert import ensure_cert
|
||||
|
|
|
@ -1949,7 +1949,7 @@ class Up2k(object):
|
|||
try:
|
||||
stl = bos.lstat(abspath)
|
||||
st = bos.stat(abspath) if stat.S_ISLNK(stl.st_mode) else stl
|
||||
except Exception as ex:
|
||||
except Exception:
|
||||
self.log("missing file: %r" % (abspath,), 3)
|
||||
f404.append((drd, dfn, w))
|
||||
continue
|
||||
|
@ -3058,7 +3058,7 @@ class Up2k(object):
|
|||
)
|
||||
self.log(t)
|
||||
raise Exception()
|
||||
except Exception as ex:
|
||||
except Exception:
|
||||
if n4g:
|
||||
st = NULLSTAT
|
||||
else:
|
||||
|
|
|
@ -1836,7 +1836,7 @@ class MultipartParser(object):
|
|||
# look for boundary near the end of the buffer
|
||||
n = 0
|
||||
for n in range(1, len(buf) + 1):
|
||||
if not buf[-n:] in self.boundary:
|
||||
if buf[-n:] not in self.boundary:
|
||||
n -= 1
|
||||
break
|
||||
|
||||
|
@ -3314,7 +3314,7 @@ def guess_mime(
|
|||
if ret.startswith("text/htm"):
|
||||
# avoid serving up HTML content unless there was actually a .html extension
|
||||
ret = "text/plain"
|
||||
except Exception as ex:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if not ret:
|
||||
|
|
Loading…
Reference in a new issue