Rev 23: Can't have a lazy imported object with the identical name as the actual module. in http://bzr.arbash-meinel.com/plugins/email

John Arbash Meinel john at arbash-meinel.com
Wed Feb 7 22:37:57 GMT 2007


At http://bzr.arbash-meinel.com/plugins/email

------------------------------------------------------------
revno: 23
revision-id: john at arbash-meinel.com-20070207223737-deytpas3j166sz72
parent: john at arbash-meinel.com-20070207154634-ua3i4hynvoj61y3p
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: email
timestamp: Wed 2007-02-07 16:37:37 -0600
message:
  Can't have a lazy imported object with the identical name as the actual module.
  It causes other code to access the member rather than accessing
  the module, causing an eventual lazy_import failure.
modified:
  __init__.py                    __init__.py-20051018071212-f1765ec4521cab0b
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2007-02-07 15:46:34 +0000
+++ b/__init__.py	2007-02-07 22:37:37 +0000
@@ -35,7 +35,7 @@
 
 # lazy_import emailer so that it doesn't get loaded if it isn't used
 lazy_import(globals(), """\
-from bzrlib.plugins.email import emailer
+from bzrlib.plugins.email import emailer as _emailer
 """)
 
 
@@ -43,12 +43,12 @@
     if not use_legacy:
         return
     """This is the post_commit hook that should get run after commit."""
-    emailer.EmailSender(branch, revision_id, branch.get_config()).send_maybe()
+    _emailer.EmailSender(branch, revision_id, branch.get_config()).send_maybe()
 
 
 def branch_commit_hook(local, master, old_revno, old_revid, new_revno, new_revid):
     """This is the post_commit hook that runs after commit."""
-    emailer.EmailSender(master, new_revid, master.get_config()).send_maybe()
+    _emailer.EmailSender(master, new_revid, master.get_config()).send_maybe()
 
 
 def install_hooks():



More information about the bazaar-commits mailing list