File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ async def __aenter__(self) -> "Client":
3434
3535 async def __aexit__ (
3636 self ,
37- exc_type : type [ BaseException ] | None = None ,
37+ exc_type : BaseException | None = None ,
3838 exc_val : BaseException | None = None ,
3939 exc_tb : TracebackType | None = None ,
4040 ) -> None :
Original file line number Diff line number Diff line change @@ -100,7 +100,12 @@ def _fetch_mapped_port(self) -> None:
100100 def _get_container_info (self ) -> dict | None :
101101 if self ._container is None :
102102 return None
103- return self ._docker_client .api .inspect_container (self ._container .id )
103+ try :
104+ if self ._container .id is None :
105+ return None
106+ return self ._docker_client .api .inspect_container (self ._container .id )
107+ except (errors .NotFound , errors .APIError ):
108+ return None
104109
105110 def get_api_token (self ) -> str :
106111 return self ._api_token
Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ def parse(unknown_object: dict) -> "EventType":
3232 schema = schema ,
3333 )
3434
35- def __hash__ (self ) -> str :
35+ def __hash__ (self ) -> int : # Changed from str to int
3636 # Convert dictionary schema to a hashable form (tuple of items)
3737 if isinstance (self .schema , dict ):
3838 # Sort items to ensure consistent hashing
3939 schema_items = tuple (sorted ((k , str (v )) for k , v in self .schema .items ()))
40- return hash ((self .event_type , self .is_phantom , schema_items ))
41- return hash ((self .event_type , self .is_phantom , self .schema ))
40+ return hash ((self .event_type , self .is_phantom , schema_items )) # Remove str() conversion
41+ return hash ((self .event_type , self .is_phantom , self .schema )) # Remove str() conversion
You can’t perform that action at this time.
0 commit comments