@@ -854,6 +854,7 @@ def extract_padding(self, s: bytes) -> Tuple[bytes, bytes]:
854854 def mysummary (self ) -> str :
855855 return "ImplClassUID %s" % self .uid .decode ("ascii" ).rstrip ("\x00 " )
856856
857+
857858class DICOMImplementationVersionName (Packet ):
858859 """DICOM Implementation Version Name sub-item."""
859860
@@ -960,8 +961,8 @@ def extract_padding(self, s: bytes) -> Tuple[bytes, bytes]:
960961 return b"" , s
961962
962963 def mysummary (self ) -> str :
963- return "SOPClassCommonExtNeg %s" % self .sop_class_uid .decode ("ascii" ).rstrip ("\x00 " )
964-
964+ uid = self .sop_class_uid .decode ("ascii" ).rstrip ("\x00 " )
965+ return "SOPClassCommonExtNeg %s" % uid
965966
966967USER_IDENTITY_TYPES = {
967968 1 : "Username" ,
@@ -1378,12 +1379,15 @@ def recv(self) -> Optional[Packet]:
13781379 log .error ("Error receiving PDU: %s" , e )
13791380 return None
13801381
1381- def sr1 (self , pkt : Packet ) -> Optional [Packet ]:
1382- try :
1383- return self .stream .sr1 (pkt , timeout = self .read_timeout )
1384- except (socket .error , OSError ) as e :
1385- log .error ("Error in sr1: %s" , e )
1386- return None
1382+ def sr1 (self , * args , ** kargs ):
1383+ # type: (*Any, **Any) -> Optional[Packet]
1384+ """Send one packet and receive one answer."""
1385+ timeout = kargs .pop ("timeout" , self .read_timeout )
1386+ try :
1387+ return self .stream .sr1 (* args , timeout = timeout , ** kargs )
1388+ except (socket .error , OSError ) as e :
1389+ log .error ("Error in sr1: %s" , e )
1390+ return None
13871391
13881392 def send_raw_bytes (self , raw_bytes : bytes ) -> None :
13891393 self .sock .sendall (raw_bytes )
0 commit comments