From f1d565239de5499bddf8828563dc7c203e2f7c23 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 12 Oct 2021 19:07:55 +0800 Subject: [PATCH] compliant python3 syntax --- pytun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytun.py b/pytun.py index 890f04f..2054975 100755 --- a/pytun.py +++ b/pytun.py @@ -130,7 +130,7 @@ def open(self): try: ret = fcntl.ioctl(self.fd, self.TUNSETIFF, struct.pack("16sH", self.pattern, self.mode | self.no_pi)) - except IOError, e: + except IOError as e: if e.errno == 1: logger.error("Cannot open a %s tunnel because the operation is not permitted." % (self.mode_name.upper(), )) raise self.NotPermitted()