mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Fix check for wrong named attributes
This commit is contained in:
parent
9359aa0688
commit
1c039389f2
1 changed files with 2 additions and 2 deletions
|
@ -18,13 +18,13 @@ class CommUDP:
|
|||
self.debug = debug
|
||||
|
||||
def open(self):
|
||||
if hasattr(self, "tx_socket"):
|
||||
if hasattr(self, "socket"):
|
||||
return
|
||||
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
self.socket.bind(("", self.port))
|
||||
|
||||
def close(self):
|
||||
if not hasattr(self, "tx_socket"):
|
||||
if not hasattr(self, "socket"):
|
||||
return
|
||||
self.socket.close()
|
||||
del self.socket
|
||||
|
|
Loading…
Reference in a new issue