stuck an error print in wintables if self.window doesn't exist

This commit is contained in:
Eric Blade 2009-11-23 10:24:38 -05:00
parent 32e7a28d2c
commit a735ab67b2

View File

@ -57,8 +57,12 @@ class Table(Table_Window):
self.window = hwnd
break
if self.window == None:
print "Window %s not found. Skipping." % search_string
try:
if self.window == None:
print "Window %s not found. Skipping." % search_string
return None
except AttributeError:
print "self.window doesn't exist? why?"
return None
(x, y, width, height) = win32gui.GetWindowRect(hwnd)
@ -149,4 +153,3 @@ class Table(Table_Window):
def win_enum_handler(hwnd, titles):
titles[hwnd] = win32gui.GetWindowText(hwnd)