Thread: python - be: Override linecache.updatecache to allow access to
python - be: Override linecache.updatecache to allow access to
From
jwp@pgfoundry.org (James William Pye)
Date:
Log Message: ----------- Override linecache.updatecache to allow access to procedures. This gives traceback.print_tb the ability to read pg_proc->prosrc by looking up the proc entry if the filename is a single, base-10 number that strtol can take. If an invalid Oid, fallback on the old function that we hold a reference for. Change tbtostr to rely on traceback.print_tb instead of format_tb and concat'ing the traceback string up ourselves. This now puts a dependency on cStringIO that is distributed with Python(might need to change how's it's used, tho =\). Spin off transform from compile as it's used in two places now, for validation and for giving the source to linecache, as the hard coded line information in the code object will cause referenced lines to be off by +1. Use format_procedure for the function name; giving a more useful represention of the function name in the traceback and anything that would reference it in the code object. Put _init in a critical section to cause FATALs. Delete the Savepoint type from module as it was just a base type for a Postgres.Transaction's Savepoint; inappropriate for the PL context. Modified Files: -------------- be/src: pl.c (r1.6 -> r1.7) (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/pl.c.diff?r1=1.6&r2=1.7)