changeset 29903:fe81c953f369

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.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 04 Sep 2016 17:19:44 +0900
parents a77d48219edd
children e4b4168a4f1c
files tests/hghave.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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,))