Kaynağa Gözat

Make Login/Register option safe

Tankernn 7 yıl önce
ebeveyn
işleme
0f953aa62c
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  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()