/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/lazy_import.py

Guard lazy imports against relative imports for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
                module_path = as_hunks[0].strip().split('.')
285
285
                if name in self.imports:
286
286
                    raise errors.ImportNameCollision(name)
 
287
                if not module_path[0]:
 
288
                    raise ImportError(path)
287
289
                # No children available in 'import foo as bar'
288
290
                self.imports[name] = (module_path, None, {})
289
291
            else:
290
292
                # Now we need to handle
291
293
                module_path = path.split('.')
292
294
                name = module_path[0]
 
295
                if not name:
 
296
                    raise ImportError(path)
293
297
                if name not in self.imports:
294
298
                    # This is a new import that we haven't seen before
295
299
                    module_def = ([name], None, {})
321
325
 
322
326
        from_module_path = from_module.split('.')
323
327
 
 
328
        if not from_module_path[0]:
 
329
            raise ImportError(from_module)
 
330
 
324
331
        for path in import_list.split(','):
325
332
            path = path.strip()
326
333
            if not path: