(self)
| 272 | self.doTest(None, files, TESTMOD) |
| 273 | |
| 274 | def testBadMagic(self): |
| 275 | # make pyc magic word invalid, forcing loading from .py |
| 276 | badmagic_pyc = bytearray(test_pyc) |
| 277 | badmagic_pyc[0] ^= 0x04 # flip an arbitrary bit |
| 278 | files = {TESTMOD + ".py": test_src, |
| 279 | TESTMOD + pyc_ext: badmagic_pyc} |
| 280 | self.doTest(".py", files, TESTMOD) |
| 281 | |
| 282 | def testBadMagic2(self): |
| 283 | # make pyc magic word invalid, causing an ImportError |