Terry J. Reedy <tjre...@udel.edu> added the comment:

On the PR, Serhiy asks "Wouldn't be better to restore sys.ps1 in test_idle if 
it is changed here?"

Aside from the fact that, as far as I know, it is not sanely possible to do so, 
I think it a bug for a test to be unnecessarily fragile.  Both ps1 and ps2 are 
set when Python is in interactive mode.  IDLE is only (partially) imitating 
Python's shell when it sets sys.ps1.

The premise of #25588 is that tests should accommodate sys.stdout and 
sys.stderr being None to the extent possible.  I think the same applies to 
sys.ps1/2 being set.  Indeed, as I reported on #31761, in msg304298, 9 days 
ago, test_code_module tests test_ps1 and test_ps2 failed when I ran '>>> import 
test.autotest' in a *Python* shell.  I did not understand the reason for the 
failures then, but if I had investigated, I should hope that I would have 
submitted the same PR, which fixes this autotest failure.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31836>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to