Commit e2bc5cd6 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Modify the stdlib to get distutils working

There are two tricky things left that I don't think we can support soon:
- MultipartConversionError uses multiple inheritance
- structseq.c sets a tp_dealloc

The structseq_dealloc function is a "simple" destructer (functionality is
covered by our GC), so we can just comment it out.  Ideally we'd have some
way of automatically determining that it's a no-op so that we don't have
to run it.
parent 087f7771
...@@ -990,6 +990,10 @@ $(FROM_CPYTHON_SRCS:.c=.o): %.o: %.c $(BUILD_SYSTEM_DEPS) ...@@ -990,6 +990,10 @@ $(FROM_CPYTHON_SRCS:.c=.o): %.o: %.c $(BUILD_SYSTEM_DEPS)
$(ECHO) Compiling C file to $@ $(ECHO) Compiling C file to $@
$(VERB) $(CC) $(EXT_CFLAGS) -c $< -o $@ -g -MMD -MP -MF $(patsubst %.o,%.d,$@) -O0 $(VERB) $(CC) $(EXT_CFLAGS) -c $< -o $@ -g -MMD -MP -MF $(patsubst %.o,%.d,$@) -O0
$(FROM_CPYTHON_SRCS:.c=.o.ll): %.o.ll: %.c $(BUILD_SYSTEM_DEPS)
$(ECHO) Compiling C file to $@
$(VERB) $(CLANG_EXE) $(EXT_CFLAGS) -S -emit-llvm -c $< -o $@ -g -MMD -MP -MF $(patsubst %.o,%.d,$@) -O3 -g0
$(FROM_CPYTHON_SRCS:.c=.release.o): %.release.o: %.c $(BUILD_SYSTEM_DEPS) $(FROM_CPYTHON_SRCS:.c=.release.o): %.release.o: %.c $(BUILD_SYSTEM_DEPS)
$(ECHO) Compiling C file to $@ $(ECHO) Compiling C file to $@
$(VERB) $(CC) $(EXT_CFLAGS) -c $< -o $@ -g -MMD -MP -MF $(patsubst %.o,%.d,$@) $(VERB) $(CC) $(EXT_CFLAGS) -c $< -o $@ -g -MMD -MP -MF $(patsubst %.o,%.d,$@)
......
...@@ -22,8 +22,11 @@ class BoundaryError(MessageParseError): ...@@ -22,8 +22,11 @@ class BoundaryError(MessageParseError):
"""Couldn't find terminating boundary.""" """Couldn't find terminating boundary."""
class MultipartConversionError(MessageError, TypeError): # Pyston change: we don't support multiple inheritance yet, so this error class is tricky.
"""Conversion to a multipart is prohibited.""" # We could make it so that it only inherits one of the base classes, but I'd rather that
# anyone who tries to use this error gets a loud error message rather than different behavior.
# class MultipartConversionError(MessageError, TypeError):
# """Conversion to a multipart is prohibited."""
class CharsetError(MessageError): class CharsetError(MessageError):
......
...@@ -41,6 +41,9 @@ PyStructSequence_New(PyTypeObject *type) ...@@ -41,6 +41,9 @@ PyStructSequence_New(PyTypeObject *type)
return (PyObject*) obj; return (PyObject*) obj;
} }
// Pyston change: we currently don't support finalizers, and this one is just a
// no-op (only decrefs and a final free), so we can just skip it.
#if 0
static void static void
structseq_dealloc(PyStructSequence *obj) structseq_dealloc(PyStructSequence *obj)
{ {
...@@ -52,6 +55,7 @@ structseq_dealloc(PyStructSequence *obj) ...@@ -52,6 +55,7 @@ structseq_dealloc(PyStructSequence *obj)
} }
PyObject_Del(obj); PyObject_Del(obj);
} }
#endif
static Py_ssize_t static Py_ssize_t
structseq_length(PyStructSequence *obj) structseq_length(PyStructSequence *obj)
...@@ -443,7 +447,8 @@ static PyTypeObject _struct_sequence_template = { ...@@ -443,7 +447,8 @@ static PyTypeObject _struct_sequence_template = {
NULL, /* tp_name */ NULL, /* tp_name */
0, /* tp_basicsize */ 0, /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
(destructor)structseq_dealloc, /* tp_dealloc */ // Pyston change: nulled this out:
0, /* tp_dealloc */
0, /* tp_print */ 0, /* tp_print */
0, /* tp_getattr */ 0, /* tp_getattr */
0, /* tp_setattr */ 0, /* tp_setattr */
......
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