<div class="gmail_quote">2012/1/7 Maciej Fijalkowski <span dir="ltr">&lt;<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">&gt; I am curious that does it hard for pypy to add those data type?<br>
&gt; like PyByteArray_Type, PyMemoryView_Type and PyInterpreterState<br>
<br>
</div>It&#39;s usually a painful experience to add new stuff to cpyext. But<br>
also, it does not necesarilly give you confidence that it&#39;ll work,<br>
since emulating CPython C API is tricky and tiny problems with<br>
refcounts can lead to segfaults that don&#39;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 &quot;import psycopg2; conn = psycopg2.connect(&#39;dbname=test&#39;)&quot;</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 &quot;/var/run/postgresql/.s.PGSQL.5432&quot;?</div><div><br></div></div><div><div><div>-- <br>Amaury Forgeot d&#39;Arc<br>

</div></div></div>