File: __init__.py

package info (click to toggle)
pypy3 7.0.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 111,848 kB
  • sloc: python: 1,291,746; ansic: 74,281; asm: 5,187; cpp: 3,017; sh: 2,533; makefile: 544; xml: 243; lisp: 45; csh: 21; awk: 4
file content (39 lines) | stat: -rw-r--r-- 1,206 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from pypy.interpreter.mixedmodule import MixedModule
from rpython.rlib.rvmprof import VMProfPlatformUnsupported
from rpython.translator.platform import CompilationError


class Module(MixedModule):
    """
    VMProf for PyPy: a statistical profiler
    """
    appleveldefs = {
    }

    interpleveldefs = {
        'enable': 'interp_vmprof.enable',
        'disable': 'interp_vmprof.disable',
        'is_enabled': 'interp_vmprof.is_enabled',
        'get_profile_path': 'interp_vmprof.get_profile_path',
        'stop_sampling': 'interp_vmprof.stop_sampling',
        'start_sampling': 'interp_vmprof.start_sampling',

        'VMProfError': 'space.fromcache(interp_vmprof.Cache).w_VMProfError',
    }


# Force the __extend__ hacks and method replacements to occur
# early.  Without this, for example, 'PyCode._init_ready' was
# already found by the annotator to be the original empty
# method, and the annotator doesn't notice that interp_vmprof.py
# (loaded later) replaces this method.
try:
    import pypy.module._vmprof.interp_vmprof
except VMProfPlatformUnsupported as e:
    pass
except CompilationError as e:
    import sys
    if sys.platform == 'win32':
        pass
    else:
        raise