~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: Robert Collins
  • Date: 2007-02-02 20:27:53 UTC
  • mto: (2257.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: robertc@robertcollins.net-20070202202753-uu1ixgssi7471vi9
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from bzrlib.lazy_import import lazy_import
36
36
lazy_import(globals(), """
37
37
import imp
 
38
import re
38
39
import types
39
40
import zipimport
40
41
 
176
177
    
177
178
    for name in plugin_names:
178
179
        try:
179
 
            exec "import bzrlib.plugins.%s" % name
 
180
            exec "import bzrlib.plugins.%s" % name in {}
180
181
        except KeyboardInterrupt:
181
182
            raise
182
183
        except Exception, e:
183
184
            ## import pdb; pdb.set_trace()
184
 
            warning('Unable to load plugin %r from %r' % (name, d))
 
185
            if re.search('\.|-| ', name):
 
186
                warning('Unable to load plugin %r from %r: '
 
187
                    'It is not a valid python module name.' % (name, d))
 
188
            else:
 
189
                warning('Unable to load plugin %r from %r' % (name, d))
185
190
            log_exception_quietly()
186
191
 
187
192