more ruff check fixes

This commit is contained in:
osman 2025-08-24 22:07:47 -07:00
parent 506a448a19
commit 9a07d1dd80
10 changed files with 9 additions and 12 deletions

View file

@ -2,7 +2,6 @@
from __future__ import print_function, unicode_literals
import argparse
import traceback
from queue import Queue

View file

@ -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:

View file

@ -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 (

View file

@ -15,7 +15,6 @@ try:
raise Exception()
HAVE_ARGON2 = True
from argon2 import exceptions as argon2ex
except:
HAVE_ARGON2 = False

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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: