| 1 |
from pypy.interpreter.mixedmodule import MixedModule |
| 2 |
from pypy.module.cpyext.state import State |
| 3 |
from pypy.module.cpyext import api |
| 4 |
|
| 5 |
class Module(MixedModule): |
| 6 |
interpleveldefs = { |
| 7 |
'is_cpyext_builtin_function': 'interp_cpyext.is_cpyext_builtin_function', |
| 8 |
'FunctionType': 'methodobject.W_PyCFunctionObject', |
| 9 |
} |
| 10 |
|
| 11 |
appleveldefs = { |
| 12 |
} |
| 13 |
|
| 14 |
atexit_funcs = [] |
| 15 |
|
| 16 |
def startup(self, space): |
| 17 |
space.fromcache(State).startup(space) |
| 18 |
|
| 19 |
def register_atexit(self, function): |
| 20 |
if len(self.atexit_funcs) >= 32: |
| 21 |
raise ValueError("cannot register more than 32 atexit functions") |
| 22 |
self.atexit_funcs.append(function) |
| 23 |
|
| 24 |
def shutdown(self, space): |
| 25 |
for func in self.atexit_funcs: |
| 26 |
func() |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
import pypy.module.cpyext.pyobject |
| 31 |
import pypy.module.cpyext.boolobject |
| 32 |
import pypy.module.cpyext.floatobject |
| 33 |
import pypy.module.cpyext.modsupport |
| 34 |
import pypy.module.cpyext.pythonrun |
| 35 |
import pypy.module.cpyext.pyerrors |
| 36 |
import pypy.module.cpyext.typeobject |
| 37 |
import pypy.module.cpyext.object |
| 38 |
import pypy.module.cpyext.bytesobject |
| 39 |
import pypy.module.cpyext.bytearrayobject |
| 40 |
import pypy.module.cpyext.tupleobject |
| 41 |
import pypy.module.cpyext.setobject |
| 42 |
import pypy.module.cpyext.dictobject |
| 43 |
import pypy.module.cpyext.longobject |
| 44 |
import pypy.module.cpyext.listobject |
| 45 |
import pypy.module.cpyext.sequence |
| 46 |
import pypy.module.cpyext.buffer |
| 47 |
import pypy.module.cpyext.eval |
| 48 |
import pypy.module.cpyext.import_ |
| 49 |
import pypy.module.cpyext.mapping |
| 50 |
import pypy.module.cpyext.iterator |
| 51 |
import pypy.module.cpyext.unicodeobject |
| 52 |
import pypy.module.cpyext.sysmodule |
| 53 |
import pypy.module.cpyext.number |
| 54 |
import pypy.module.cpyext.sliceobject |
| 55 |
import pypy.module.cpyext.stubsactive |
| 56 |
import pypy.module.cpyext.pystate |
| 57 |
import pypy.module.cpyext.capsule |
| 58 |
import pypy.module.cpyext.cdatetime |
| 59 |
import pypy.module.cpyext.complexobject |
| 60 |
import pypy.module.cpyext.weakrefobject |
| 61 |
import pypy.module.cpyext.funcobject |
| 62 |
import pypy.module.cpyext.frameobject |
| 63 |
import pypy.module.cpyext.classobject |
| 64 |
import pypy.module.cpyext.exception |
| 65 |
import pypy.module.cpyext.memoryobject |
| 66 |
import pypy.module.cpyext.codecs |
| 67 |
import pypy.module.cpyext.pyfile |
| 68 |
import pypy.module.cpyext.pystrtod |
| 69 |
import pypy.module.cpyext.pytraceback |
| 70 |
import pypy.module.cpyext.methodobject |
| 71 |
import pypy.module.cpyext.dictproxyobject |
| 72 |
import pypy.module.cpyext.marshal |
| 73 |
import pypy.module.cpyext.genobject |
| 74 |
import pypy.module.cpyext.namespaceobject |
| 75 |
import pypy.module.cpyext.pystrhex |
| 76 |
import pypy.module.cpyext.contextvars |
| 77 |
|
| 78 |
|
| 79 |
api.configure_types() |