Skip to content

Commit a3d7805

Browse files
author
hfitzp200_comcast
committed
ModuleNotFoundError is finer grain
1 parent 5325978 commit a3d7805

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

framework/core/commandModules/telnetClass.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
try:
3434
import telnetlib
35-
except ImportError:
35+
except ModuleNotFoundError:
3636
# telnetlib was removed in Python 3.13, provide a minimal compatibility layer
3737
import socket
3838
import time
@@ -222,15 +222,15 @@ def read_until(self,value: str, timeout: int = 10) -> str:
222222
message = value.encode()
223223
result = self.tn.read_until(message,self.timeout)
224224
return result.decode()
225-
225+
226226
def read_all(self) -> str:
227227
"""Read all readily available information displayed in the console.
228228
229229
Returns:
230230
str: Information currently displayed in the console.
231231
"""
232232
return self.read_eager()
233-
233+
234234
def write(self,message:list|str, lineFeed:str="\r\n", wait_for_prompt:bool=False) -> bool:
235235
"""Write a message into the session console.
236236
Optional: waits for prompt.

framework/core/testControl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import random
3636
try:
3737
import telnetlib
38-
except ImportError:
38+
except ModuleNotFoundError:
3939
# telnetlib was removed in Python 3.13, this is handled in telnetClass.py
4040
telnetlib = None
4141
import os

0 commit comments

Comments
 (0)