Explorar el Código

Make Login/Register option safe

Tankernn hace 7 años
padre
commit
0f953aa62c
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      cbc/client.py

+ 5 - 1
cbc/client.py

@@ -210,7 +210,11 @@ def connect():
         print("1. Login")
         print("2. Register")
         print("> ", end="", flush=True)
-        option = int(input())
+        try:
+            option = int(input())
+        except ValueError:
+            print("Please enter an integer value.")
+            continue
 
     print("Username: ", end="", flush=True)
     username = input()