Rev 585: Try to import rather than use getattr to avoid problems wrt the order in which plugins are loaded. in file:///data/jelmer/bzr-gtk/trunk/

Jelmer Vernooij jelmer at samba.org
Thu Jul 31 02:51:57 BST 2008


At file:///data/jelmer/bzr-gtk/trunk/

------------------------------------------------------------
revno: 585
revision-id: jelmer at samba.org-20080731015156-ow92ihsd75csbk46
parent: jelmer at samba.org-20080731011143-5psmig13676a5dmc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Thu 2008-07-31 03:51:56 +0200
message:
  Try to import rather than use getattr to avoid problems wrt the order in which plugins are loaded.
modified:
  __init__.py                    __init__.py-20060519165329-a1fd52c8a829fcd5
=== modified file '__init__.py'
--- a/__init__.py	2008-07-31 01:09:01 +0000
+++ b/__init__.py	2008-07-31 01:51:56 +0000
@@ -567,7 +567,11 @@
     cmd_visualise
     ]
 
-if getattr(bzrlib.plugins, "loom", None) is not None:
+try:
+    from bzrlib.plugins import loom
+except ImportError:
+    pass # Loom plugin doesn't appear to be present
+else:
     commands.append(cmd_gloom)
 
 for cmd in commands:




More information about the bazaar-commits mailing list