Merge excepts together

This commit is contained in:
Jonathan Corwin 2010-06-24 20:42:15 +01:00
parent bbf5ecf0fc
commit 30f8441ce9
2 changed files with 4 additions and 9 deletions

View File

@ -186,9 +186,7 @@ class PowerpointDocument(PresentationDocument):
return False return False
if self.presentation.SlideShowWindow.View is None: if self.presentation.SlideShowWindow.View is None:
return False return False
except AttributeError: except (AttributeError, pywintypes.com_error):
return False
except pywintypes.com_error:
return False return False
return True return True
@ -210,9 +208,9 @@ class PowerpointDocument(PresentationDocument):
""" """
Returns true if screen is blank Returns true if screen is blank
""" """
try: if self.is_active():
return self.presentation.SlideShowWindow.View.State == 3 return self.presentation.SlideShowWindow.View.State == 3
except pywintypes.com_error: else:
return False return False
def stop_presentation(self): def stop_presentation(self):

View File

@ -58,10 +58,7 @@ class PptviewController(PresentationController):
log.debug(u'check_available') log.debug(u'check_available')
if os.name != u'nt': if os.name != u'nt':
return False return False
try: return self.check_installed()
return self.check_installed()
except:
return False
if os.name == u'nt': if os.name == u'nt':
def check_installed(self): def check_installed(self):