gnome-games r7285 - trunk/glchess/src/lib/ggz



Author: rancell
Date: Mon Jan 28 09:34:27 2008
New Revision: 7285
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7285&view=rev

Log:
Handle unknown response data


Modified:
   trunk/glchess/src/lib/ggz/chess.py

Modified: trunk/glchess/src/lib/ggz/chess.py
==============================================================================
--- trunk/glchess/src/lib/ggz/chess.py	(original)
+++ trunk/glchess/src/lib/ggz/chess.py	Mon Jan 28 09:34:27 2008
@@ -67,7 +67,11 @@
 
     def decode(self, char):
         if self.decodeMethod is None:
-            self.decodeMethod = self.decodeMethods[char]
+            try:
+                self.decodeMethod = self.decodeMethods[char]
+            except KeyError:
+                print 'Unknown data received: %s' % repr(char)                
+                return
             self.command = ''
         self.command += char
         self.decodeMethod()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]