Merge lp:~spiv/meliae/frame-info into lp:meliae

Proposed by Andrew Bennetts
Status: Merged
Approved by: John A Meinel
Approved revision: 149
Merged at revision: 151
Proposed branch: lp:~spiv/meliae/frame-info
Merge into: lp:meliae
Diff against target: 29 lines (+8/-0)
2 files modified
meliae/_scanner_core.c (+6/-0)
meliae/_scanner_core.h (+2/-0)
To merge this branch: bzr merge lp:~spiv/meliae/frame-info
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+29726@code.launchpad.net

Description of the change

I haven't tested it does what I expect, but it compiles and passes tests, and it *looks* plausible...

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> Andrew Bennetts has proposed merging lp:~spiv/meliae/frame-info into lp:meliae.
>
> Requested reviews:
> Meliae Development Team (meliae-dev)
>
>
> I haven't tested it does what I expect, but it compiles and passes tests, and it *looks* plausible...
>

I went ahead and wrote a test that used sys._get_frame().

 merge: approve

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw7eRUACgkQJdeBCYSNAAP0LwCeKMkmKUTRPIOP6DS17yah+sru
YKsAoJzZMEliONezDHFRsZtJlMFOf9Jq
=fhK5
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'meliae/_scanner_core.c'
2--- meliae/_scanner_core.c 2010-06-30 18:05:55 +0000
3+++ meliae/_scanner_core.c 2010-07-12 17:16:44 +0000
4@@ -472,6 +472,12 @@
5 _write_to_ref_info(info, ", \"len\": " SSIZET_FMT, PySet_GET_SIZE(c_obj));
6 } else if (PyDict_Check(c_obj)) {
7 _write_to_ref_info(info, ", \"len\": " SSIZET_FMT, PyDict_Size(c_obj));
8+ } else if (PyFrame_Check(c_obj)) {
9+ PyCodeObject *co = ((PyFrameObject*)c_obj)->f_code;
10+ if (co) {
11+ _write_static_to_info(info, ", \"value\": ");
12+ _dump_string(info, co->co_name);
13+ }
14 }
15 _write_static_to_info(info, ", \"refs\": [");
16 do_traverse = 1;
17
18=== modified file 'meliae/_scanner_core.h'
19--- meliae/_scanner_core.h 2009-12-30 16:25:15 +0000
20+++ meliae/_scanner_core.h 2010-07-12 17:16:44 +0000
21@@ -23,6 +23,8 @@
22 #define _SCANNER_CORE_H_
23
24 #include <Python.h>
25+#include <code.h>
26+#include <frameobject.h>
27 #include <stdio.h>
28
29 /**

Subscribers

People subscribed via source and target branches

to all changes: