Commit ee912194 authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Kevin Modzelewski

Some minor improvements

parent 715ace3a
# Copy any changed stdlib files to the destination: # Copy any changed stdlib files to the destination:
file(GLOB_RECURSE STDLIB_SRCS Lib/*.py) file(GLOB_RECURSE STDLIB_SRCS Lib/*.py)
file(GLOB STDLIB_MORE_SRCS Lib/lib2to3/*.txt)
set(STDLIB_SRCS ${STDLIB_MORE_SRCS} ${STDLIB_SRCS})
file(GLOB STDLIB_MORE_SRCS Lib/email/test/data/*)
set(STDLIB_SRCS ${STDLIB_MORE_SRCS} ${STDLIB_SRCS})
file(GLOB_RECURSE STD_INCLUDES Include/*.h) file(GLOB_RECURSE STD_INCLUDES Include/*.h)
set(STDLIB_TARGETS "") set(STDLIB_TARGETS "")
foreach(STDLIB_FILE ${STDLIB_SRCS}) foreach(STDLIB_FILE ${STDLIB_SRCS})
...@@ -181,6 +188,7 @@ add_custom_command(OUTPUT ${STDMODULES} ...@@ -181,6 +188,7 @@ add_custom_command(OUTPUT ${STDMODULES}
DEPENDS DEPENDS
pyston pyston
copy_stdlib copy_stdlib
setup.py
Modules/_multiprocessing/multiprocessing.c Modules/_multiprocessing/multiprocessing.c
Modules/_multiprocessing/semaphore.c Modules/_multiprocessing/semaphore.c
Modules/_multiprocessing/socket_connection.c Modules/_multiprocessing/socket_connection.c
......
...@@ -7,8 +7,7 @@ import re ...@@ -7,8 +7,7 @@ import re
import os.path import os.path
import tempfile import tempfile
import subprocess import subprocess
# Pyston change: we can't import this currently import py_compile
# import py_compile
import contextlib import contextlib
import shutil import shutil
try: try:
......
# expected: fail
# Skipping test_parser and test_all_fixers # Skipping test_parser and test_all_fixers
# because of running # because of running
from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor, from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
......
# expected: fail # skip-if: True
# - this isn't an actual test file
"""Supporting definitions for the Python regression tests.""" """Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support': if __name__ != 'test.test_support':
......
...@@ -436,7 +436,7 @@ w_object(PyObject *v, WFILE *p) ...@@ -436,7 +436,7 @@ w_object(PyObject *v, WFILE *p)
} }
else if (PyCode_Check(v)) { else if (PyCode_Check(v)) {
// Pyston change: not implemented // Pyston change: not implemented
assert(0 && "not implemented"); assert(0 && "Marshalling of code objects not implemented");
abort(); abort();
/* /*
PyCodeObject *co = (PyCodeObject *)v; PyCodeObject *co = (PyCodeObject *)v;
......
...@@ -3477,10 +3477,23 @@ static int object_set_class(PyObject* self, PyObject* value, void* closure) noex ...@@ -3477,10 +3477,23 @@ static int object_set_class(PyObject* self, PyObject* value, void* closure) noex
} }
} }
static PyObject* object_sizeof(PyObject* self, PyObject* args) noexcept {
Py_ssize_t res, isize;
res = 0;
isize = self->cls->tp_itemsize;
if (isize > 0)
res = self->cls->ob_size * isize;
res += self->cls->tp_basicsize;
return PyInt_FromSsize_t(res);
}
static PyMethodDef object_methods[] = { static PyMethodDef object_methods[] = {
{ "__reduce_ex__", object_reduce_ex, METH_VARARGS, NULL }, // { "__reduce_ex__", object_reduce_ex, METH_VARARGS, NULL }, //
{ "__reduce__", object_reduce, METH_VARARGS, NULL }, // { "__reduce__", object_reduce, METH_VARARGS, NULL }, //
{ "__format__", object_format, METH_VARARGS, PyDoc_STR("default object formatter") }, { "__format__", object_format, METH_VARARGS, PyDoc_STR("default object formatter") },
{ "__sizeof__", object_sizeof, METH_NOARGS, PyDoc_STR("__sizeof__() -> int\nsize of object in memory, in bytes") },
{ NULL, NULL, 0, NULL }, { NULL, NULL, 0, NULL },
}; };
......
...@@ -101,8 +101,7 @@ test_iterlen [unknown] ...@@ -101,8 +101,7 @@ test_iterlen [unknown]
test_itertools [unknown] test_itertools [unknown]
test_json 'from test.script_helper import assert_python_ok' fails; sounds like it is trying to look at pycs test_json 'from test.script_helper import assert_python_ok' fails; sounds like it is trying to look at pycs
test_kqueue Not really a failure, but it tries to skip itself and we don't support that test_kqueue Not really a failure, but it tries to skip itself and we don't support that
test_lib2to3 [unknown] test_linuxaudiodev No module named audioop
test_linuxaudiodev [unknown]
test_list longs as slice indices test_list longs as slice indices
test_long_future [unknown] test_long_future [unknown]
test_macos Not really a failure, but it tries to skip itself and we don't support that test_macos Not really a failure, but it tries to skip itself and we don't support that
......
...@@ -573,7 +573,7 @@ def main(orig_dir): ...@@ -573,7 +573,7 @@ def main(orig_dir):
filtered_tests.append(t) filtered_tests.append(t)
tests = filtered_tests tests = filtered_tests
if not tests: if not tests:
print >>sys.stderr, "No tests matched the given patterns. OK by me!" # print >>sys.stderr, "No tests matched the given patterns. OK by me!"
# this can happen legitimately in e.g. `make check_test_foo` if test_foo.py is a CPython regression test. # this can happen legitimately in e.g. `make check_test_foo` if test_foo.py is a CPython regression test.
sys.exit(0) sys.exit(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment