From 65391a9d8c6cccda06e6c4e627d5f2d4586d0aa5 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 2 Jan 2026 16:56:03 +0000 Subject: [PATCH] more linter fixing --- copyparty/httpcli.py | 10 +++++----- copyparty/util.py | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 436b705b..2782bd83 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -5394,7 +5394,7 @@ class HttpCli(object): "dbwt": None, } - assert vstate and vstate.items and vs # type: ignore # !rm + assert vstate is not None and vstate.items and vs # type: ignore # !rm dls = dl_list = [] if self.conn.hsrv.tdls: @@ -5945,7 +5945,7 @@ class HttpCli(object): if shr_dbv: # translate vpaths from share-target to share-url # to satisfy access checks - assert shr_vrem and shr_vrem.split # type: ignore # !rm + assert shr_vrem is not None and shr_vrem.split # type: ignore # !rm vp_shr, vp_vfs = vroots(self.vpath, vjoin(shr_dbv.vpath, shr_vrem)) for v in ret: vp = v["vp"] @@ -7377,7 +7377,7 @@ class HttpCli(object): ogh["og:site_name"] = zs try: - assert file # type: ignore # !rm + assert file is not None # type: ignore # !rm zs1, zs2 = file["tags"]["res"].split("x") file["tags"][".resw"] = zs1 file["tags"][".resh"] = zs2 @@ -7417,7 +7417,7 @@ class HttpCli(object): } try: - assert file # type: ignore # !rm + assert file is not None # type: ignore # !rm for k, v in file["tags"].items(): zs = "{{ %s }}" % (k,) title = title.replace(zs, str(v)) @@ -7434,7 +7434,7 @@ class HttpCli(object): for tag, hname in tagmap.items(): try: - assert file # type: ignore # !rm + assert file is not None # type: ignore # !rm v = file["tags"][tag] if not v: continue diff --git a/copyparty/util.py b/copyparty/util.py index 9b1c3cf1..ff5c8c10 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -2284,9 +2284,8 @@ def sanitize_to(fn: str, tl: dict[int, int]) -> str: def sanitize_vpath(vp: str) -> str: - if not FNTL_OS: + if not APTL_OS: return vp - assert APTL_OS # type: ignore # !rm parts = vp.replace(os.sep, "/").split("/") ret = [sanitize_to(x, APTL_OS) for x in parts] return "/".join(ret)