[ 1005248 ] new.code() not cleanly checking its arguments
using the result of new.code() can still destroy the sun, but merely
calling the function shouldn't any more.
I also rewrote the existing tests of new.code() to use vastly less
un-bogus arguments, and added tests for the previous insane behaviours.
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".
This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).
Now Tim and Jack can have at it. :)
#403666. Specifically,
In codestr, force `c' to be global. It's unclear what the semantics
should be for a code object compiled at module scope, but bound and
run in a function. In CPython, `c' is global (by accident?) while in
Jython, `c' is local. The intent of the test clearly is to make `c'
global, so let's be explicit about it.
Jython also does not have a __builtins__ name in the module's
namespace, so we use a more portable alternative (though I'm not sure
why the test requires "__builtins__" in the g namespace).
Finally, skip the new.code() test if the new module doesn't have a
`code' attribute. Jython will never have this.
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
test_*: converted to the new test harness. GvR note! test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness. It must be a timing issue, but I haven't figured it out
yet.
I'm really not sure what the proper inputs are. I do flex the
function call though by passing in arguments of the proper type. I
don't try to exec the code object that gets returned!