cmdutil: use crecordmod.checkcurses
Instead of blindly trusting the user's experimental.crecord, we use checkcurses
to abstract that logic so that we can handle the case where python was not
built with curses.
crecord: ensure that curses is False if not imported
This provides no functional change but makes the next two patches easier to
review.
crecord: add helper function to determine if we should use curses
To fix
issue5008 properly, we need a helper function to determine if curses is
imported and also if the user has enabled the experimental flag.
crecord: use try/except for import of curses
Not only does this improve fragility with 'if os.name == ...' it will help
future patches enable the behavior to fallback to use plain record when curses
is unavailable (e.g. python compiled without curses support).
histedit: only use pickle if not using the modern save format
This avoids a case where PyPy's cPickle module throws a more confusing
error than CPython's.
perf: close transaction in perffncachewrite
This fixes a bug, and brings CPython behaviour on this test into
line with PyPy.
hbisect: use tryreadlines to load state
This closes the file handle after reading, which stops PyPy from
leaking open file handles and thus failing test-bisect3.t.
eol: make output stable
This eliminates a divergence in behaviour between PyPy and Python.