equal
deleted
inserted
replaced
230 from mercurial import util |
230 from mercurial import util |
231 |
231 |
232 # Unlike the import statement, __import__() function should not raise |
232 # Unlike the import statement, __import__() function should not raise |
233 # ImportError even if fromlist has an unknown item |
233 # ImportError even if fromlist has an unknown item |
234 # (see Python/import.c:import_module_level() and ensure_fromlist()) |
234 # (see Python/import.c:import_module_level() and ensure_fromlist()) |
235 assert 'zipfile' not in sys.modules |
235 assert 'ftplib' not in sys.modules |
236 zipfileimp = __import__('zipfile', globals(), locals(), ['unknownattr']) |
236 zipfileimp = __import__('ftplib', globals(), locals(), ['unknownattr']) |
237 assert f(zipfileimp) == "<module 'zipfile' from '?'>", f(zipfileimp) |
237 assert f(zipfileimp) == "<module 'ftplib' from '?'>", f(zipfileimp) |
238 assert not util.safehasattr(zipfileimp, 'unknownattr') |
238 assert not util.safehasattr(zipfileimp, 'unknownattr') |