Gregory P. Smith added the comment: This shouldn't be happening and makes no sense. It looks like the assert statement was removed at import code compilation time given the pdb trace with it from a zip file vs with it outside of a zip file:
>>> pdb.run('mod.test(False)') > <string>(1)<module>() (Pdb) n False --Return-- > <string>(1)<module>()->None (Pdb) n >>> pdb.run('mod.test(False)') > <string>(1)<module>()->None (Pdb) s --Call-- > oss/cpython/build/mod.zip/mod.py(1)test() -> def test(val): (Pdb) s > oss/cpython/build/mod.zip/mod.py(3)test() -> print(val) (Pdb) s False --Return-- > oss/cpython/build/mod.zip/mod.py(3)test()->None -> print(val) (Pdb) s --Return-- > <string>(1)<module>()->None (Pdb) s > oss/cpython/default/Lib/bdb.py(435)run() -> self.quitting = True (Pdb) s >>> vs no zip file: >>> pdb.run('mod.test(False)') > <string>(1)<module>() (Pdb) s --Call-- > oss/cpython/build/mod.py(1)test() -> def test(val): (Pdb) s > oss/cpython/build/mod.py(2)test() -> assert(val) (Pdb) s AssertionError > oss/cpython/build/mod.py(2)test() -> assert(val) (Pdb) s --Return-- > oss/cpython/build/mod.py(2)test()->None -> assert(val) (Pdb) s AssertionError > <string>(1)<module>() (Pdb) s --Return-- > <string>(1)<module>()->None (Pdb) s AssertionError > oss/cpython/default/Lib/bdb.py(431)run() -> exec(cmd, globals, locals) (Pdb) s > oss/cpython/default/Lib/bdb.py(432)run() -> except BdbQuit: (Pdb) s > oss/cpython/default/Lib/bdb.py(435)run() -> self.quitting = True (Pdb) s Traceback (most recent call last): File "<stdin>", line 1, in <module> File "oss/cpython/default/Lib/pdb.py", line 1568, in run Pdb().run(statement, globals, locals) File "oss/cpython/default/Lib/bdb.py", line 431, in run exec(cmd, globals, locals) File "<string>", line 1, in <module> File "oss/cpython/build/mod.py", line 2, in test assert(val) AssertionError ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28131> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com