mercurial/hook.py
changeset 28109 b892e424f88c
parent 28108 2a71d9483199
child 28936 44bd37af54e5
--- a/mercurial/hook.py	Fri Feb 12 11:44:35 2016 -0800
+++ b/mercurial/hook.py	Fri Feb 12 14:50:10 2016 -0800
@@ -49,12 +49,12 @@
         with demandimport.deactivated():
             try:
                 obj = __import__(modname)
-            except ImportError:
+            except (ImportError, SyntaxError):
                 e1 = sys.exc_info()
                 try:
                     # extensions are loaded with hgext_ prefix
                     obj = __import__("hgext_%s" % modname)
-                except ImportError:
+                except (ImportError, SyntaxError):
                     e2 = sys.exc_info()
                     if ui.tracebackflag:
                         ui.warn(_('exception from first failed import '