Show More
@@ -911,7 +911,8 b' class InteractiveShell(SingletonConfigurable):' | |||
|
911 | 911 | try: |
|
912 | 912 | main_mod = self._main_mod_cache[filename] |
|
913 | 913 | except KeyError: |
|
914 |
main_mod = self._main_mod_cache[filename] = types.ModuleType( |
|
|
914 | main_mod = self._main_mod_cache[filename] = types.ModuleType( | |
|
915 | py3compat.cast_bytes_py2(modname), | |
|
915 | 916 | doc="Module created for script run in IPython") |
|
916 | 917 | else: |
|
917 | 918 | main_mod.__dict__.clear() |
@@ -472,6 +472,12 b' class InteractiveShellTestCase(unittest.TestCase):' | |||
|
472 | 472 | with open(filename, 'r') as f: |
|
473 | 473 | self.assertEqual(f.read(), 'blah') |
|
474 | 474 | |
|
475 | def test_new_main_mod(self): | |
|
476 | # Smoketest to check that this accepts a unicode module name | |
|
477 | name = u'jiefmw' | |
|
478 | mod = ip.new_main_mod(u'%s.py' % name, name) | |
|
479 | self.assertEqual(mod.__name__, name) | |
|
480 | ||
|
475 | 481 | class TestSafeExecfileNonAsciiPath(unittest.TestCase): |
|
476 | 482 | |
|
477 | 483 | @onlyif_unicode_paths |
General Comments 0
You need to be logged in to leave comments.
Login now