<div class="gmail_quote">2012/1/7 Maciej Fijalkowski <span dir="ltr"><<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> I am curious that does it hard for pypy to add those data type?<br>
> like PyByteArray_Type, PyMemoryView_Type and PyInterpreterState<br>
<br>
</div>It's usually a painful experience to add new stuff to cpyext. But<br>
also, it does not necesarilly give you confidence that it'll work,<br>
since emulating CPython C API is tricky and tiny problems with<br>
refcounts can lead to segfaults that don't occur on cpython for<br>
obscure reasons.</blockquote></div><div><br></div>I looked at the compilation messages, and added the missing parts;<div>it was not that difficult, after all :-)</div><div><br></div><div>The module should now compile, provided you apply the attached patch to psycopg.</div>
<div>(I suggested the PyDateTime_DELTA_GET_DAYS macros to CPython: </div><div><a href="http://bugs.python.org/issue13727">http://bugs.python.org/issue13727</a> )</div><div><br></div><div>The resulting module works a little... at least it yielded a meaningful error message:</div>
<div><br></div><div>$ ./pypy-c -c "import psycopg2; conn = psycopg2.connect('dbname=test')"</div><div><div>OperationalError: could not connect to server: No such file or directory</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Is the server running locally and accepting</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?</div><div><br></div></div><div><div><div>-- <br>Amaury Forgeot d'Arc<br>
</div></div></div>