From 3f4dabe45cd715c5750770499eb7c893da40e85a Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 10 Apr 2026 19:59:50 +0000 Subject: [PATCH] diff-golf :) Signed-off-by: ed --- copyparty/tcpsrv.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index feb21ccb..c98b1d3b 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -516,13 +516,13 @@ class TcpSrv(object): if not ln.startswith("default"): continue yield ln.split()[7] if OPENBSD else ln.split()[3] - else: - with open("/proc/net/route", "rb") as f: - next(f) - for ln in f: - r = ln.decode("utf-8").strip().split() - if r[1] == "0" * 8 and int(r[3], 16) & 2: - yield r[0] + return + with open("/proc/net/route", "rb") as f: + next(f) + for ln in f: + r = ln.decode("utf-8").strip().split() + if r[1] == "0" * 8 and int(r[3], 16) & 2: + yield r[0] def _defroute(self) -> str: ret = ""