From 34d9d92fbe17ba5efe87808f1af7b37604b38d11 Mon Sep 17 00:00:00 2001 From: FredyVia <43921304+FredyVia@users.noreply.github.com> Date: Fri, 18 Feb 2022 15:54:11 +0800 Subject: [PATCH] =?UTF-8?q?[bug]python=E4=B8=ADfinally=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref:[python finally 问题](https://stackoverflow.com/questions/19805654/python-try-finally-block-returns) --- latest-wired-python3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latest-wired-python3.py b/latest-wired-python3.py index 56cbc52..1ee5406 100644 --- a/latest-wired-python3.py +++ b/latest-wired-python3.py @@ -61,7 +61,7 @@ def get_ip_address(ifname): except IOError as e: print(nic_name + 'is unacceptable !') return '0.0.0.0' - finally: + except: return '0.0.0.0' if nic_name != '':