Skip to content

Commit 631d5d2

Browse files
committed
Defer creation of abort channel
1 parent 65821e9 commit 631d5d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vxi11/vxi11.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,6 @@ def open(self):
578578
raise Vxi11Exception(error, 'open')
579579

580580
self.abort_port = abort_port
581-
self.abort_client = AbortClient(self.host, abort_port)
582-
self.abort_client.sock.settimeout(self.timeout)
583581

584582
self.link = link
585583
self.max_recv_size = min(max_recv_size, 1024*1024)
@@ -599,7 +597,10 @@ def abort(self):
599597
if self.link is None:
600598
self.open()
601599

602-
self.abort_client.sock.settimeout(1.0)
600+
if self.abort_client is None:
601+
self.abort_client = AbortClient(self.host, self.abort_port)
602+
self.abort_client.sock.settimeout(self.timeout)
603+
603604
error = self.abort_client.device_abort(self.link)
604605

605606
if error:

0 commit comments

Comments
 (0)