hghave: fix has_bzr() to not try to import RevisionSpec as module
authorYuya Nishihara <yuya@tcha.org>
Sun, 04 Sep 2016 17:19:44 +0900
changeset 29903 fe81c953f369
parent 29902 a77d48219edd
child 29904 e4b4168a4f1c
hghave: fix has_bzr() to not try to import RevisionSpec as module Since RevisionSpec isn't a module, "import bzrlib.revisionspec.RevisionSpec" would always raise ImportError.
tests/hghave.py
--- a/tests/hghave.py	Mon Aug 22 14:44:14 2016 +0200
+++ b/tests/hghave.py	Sun Sep 04 17:19:44 2016 +0900
@@ -113,9 +113,10 @@
         import bzrlib.bzrdir
         import bzrlib.errors
         import bzrlib.revision
-        import bzrlib.revisionspec.RevisionSpec
+        import bzrlib.revisionspec
+        bzrlib.revisionspec.RevisionSpec
         return bzrlib.__doc__ is not None
-    except ImportError:
+    except (AttributeError, ImportError):
         return False
 
 @checkvers("bzr", "Canonical's Bazaar client >= %s", (1.14,))