1
0
Эх сурвалжийг харах

ctrl-c的一些问题修复

SongZihuan 4 жил өмнө
parent
commit
45bb307445
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      main.py

+ 2 - 2
main.py

@@ -308,7 +308,7 @@ class Menu:
                 if not self.__menu():
                 if not self.__menu():
                     break
                     break
             except KeyboardInterrupt:
             except KeyboardInterrupt:
-                print("\n")
+                print("\n", end="")
             except BaseException as e:
             except BaseException as e:
                 print(f"There are some Error:\n{e}\n")
                 print(f"There are some Error:\n{e}\n")
 
 
@@ -317,7 +317,7 @@ class Menu:
             command = input(f'[\033[4mSSearch\033[0m] > ')  # 输入一条指令
             command = input(f'[\033[4mSSearch\033[0m] > ')  # 输入一条指令
         except KeyboardInterrupt:
         except KeyboardInterrupt:
             print("\nPlease Enter 'quit' or 'q' to quit")
             print("\nPlease Enter 'quit' or 'q' to quit")
-            raise
+            return True
 
 
         if command == "q" or command == "quit":
         if command == "q" or command == "quit":
             print("SSearch: Bye Bye!")
             print("SSearch: Bye Bye!")