[issue32806] locally imported modules are unaccessible in lambdas in pdb

2018-02-11 Thread Nitish
Nitish added the comment: Sorry. I didn't finish my last message. Is the behaviour described in that message a bug? If yes, that would explain the original behaviour. If no, why not? -- ___ Python tracker

[issue32806] locally imported modules are unaccessible in lambdas in pdb

2018-02-11 Thread Nitish
Nitish added the comment: This can be traced back to the following issue: >>> c = compile("(lambda: re.findall('a', 'aaa'))()", "", "single") >>> import re as rea >>> exec(c, None, {'re': rea}) NameError: name 're' is not defined. Seeing disassembly of the compiled

[issue32806] locally imported modules are unaccessible in lambdas in pdb

2018-02-10 Thread Nitish
Change by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___ Python-bugs-list

[issue32806] locally imported modules are unaccessible in lambdas in pdb

2018-02-09 Thread Yuri Kanivetsky
New submission from Yuri Kanivetsky : Consider the following script: # import pdb; pdb.set_trace() # import re def f(): import re print((lambda: re.findall('a', 'aaa'))()) import pdb; pdb.set_trace() print('test') f()