diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-08-25 23:08:38 +0100 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-08-28 02:17:46 +0100 |
| commit | 54d904138dc7c3f8d39fa928c836474faa18dcd6 (patch) | |
| tree | f59f571df4ae5a9e111ad98a23b00b9ccf241f5e /scripts/make_errorcodes.py | |
| parent | df9fbc515d6f586e84d7853965f2bc544177ac6a (diff) | |
| download | psycopg2-54d904138dc7c3f8d39fa928c836474faa18dcd6.tar.gz | |
Don't import psycopg2.tz into the C extension
This makes possible to import _psycopg directly, after adding the
package directory to the pythonpath. This enables hacks such as:
sys.path.insert(0, '/path/to/psycopg2')
import _psycopg
sys.modules['psycopg2._psycopg'] = _psycopg
sys.path.pop(0)
which can work around e.g. the problem of #201, freeze that cannot
freeze psycopg2. Well, freeze cannot freeze it because it's just not
designed to deal with C extensions. At least now the frozen application
can hack the pythonpath and work around the limitation by importing
_psycopg as above and then doing the rest of the imports normally.
Keeping long-lived references to python objects is bad anyway: the
tz module couldn't be reloaded before.
Diffstat (limited to 'scripts/make_errorcodes.py')
0 files changed, 0 insertions, 0 deletions
