On 5/5/25 11:12, David Wei wrote:
On 5/5/25 10:47, Jakub Kicinski wrote:
On Fri, 2 May 2025 21:54:11 -0700 David Wei wrote:
   def _test_v4(cfg) -> None:
-    cfg.require_ipver("4")
+    if not cfg.addr_v["4"]:
+        return

What if cfg.remote_addr_v['4'] doesn't exist?

Not sure if its super pythonic but it's set to None in the lib
if user doesn't provide the config.

Ah okay. I'm concerned about the next line:

        cmd("ping -c 1 -W0.5 " + cfg.remote_addr_v["4"])

If cfg.remote_addr_v["4"] is None by default then Python will complain:

   >>> a = "foo test bar" + None
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: can only concatenate str (not "NoneType") to str

NVM, it's obviously checked for.

Reply via email to