Eliminated duplicate import.
[super-star-trek.git] / sst
diff --git a/sst b/sst
index beff5c9cf497a2bc9d9ac35577a9bc4981833590..79c5683065fc710013ea8aeca1cfff3532728fc7 100755 (executable)
--- a/sst
+++ b/sst
@@ -18,7 +18,7 @@ on how to modify (and how not to modify!) this code.
 
 # pylint: disable=multiple-imports
 import os, sys, math, curses, time, pickle, copy, gettext, getpass
-import getopt, socket, locale, getpass
+import getopt, socket, locale
 import codecs
 
 # This import only works on Unixes.  The intention is to enable
@@ -6653,14 +6653,14 @@ class sstscanner:
         s = Coord()
         self.nexttok()
         if (game.options & OPTION_ALPHAMERIC):
-            if (self.type == "IHALPHA") and (self.token[0] in "abcdefghij") and (self.token[1] in "0123456789"):
-                s.i = ord(self.token[0]) - ord("a")
-                try:
-                    s.j = int(self.token[-1:])-1
-                except TypeError:
-                    huh()
-                    return None
-                return s
+            try:
+                if (self.type == "IHALPHA") and (self.token[0] in "abcdefghij") and (self.token[1] in "0123456789"):
+                    s.i = ord(self.token[0]) - ord("a")
+                    s.j = int(self.token[1:])-1
+                    return s
+            except (TypeError, IndexError):
+                huh()
+                return None
         if self.type != "IHREAL":
             huh()
             return None