Update for Python 2.7. This is release 1.0.3.
[mLib-python] / ident.pyx
index e7c05d2..47de397 100644 (file)
--- a/ident.pyx
+++ b/ident.pyx
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
-# 
+#
 # mLib/Python is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with mLib/Python; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -52,7 +52,7 @@ cdef class SelIdentify:
   cdef _error
   cdef _failed
   cdef _bogus
-  def __new__(me, sk,
+  def __cinit__(me, sk,
               userproc = None, bogusproc = None,
               badproc = None, errorproc = None, failedproc = None,
               *hunoz, **hukairz):
@@ -157,7 +157,7 @@ cdef class SelIdentify:
   def bogus(me):
     return _maybecall(me._bogus, ())
 
-cdef void _identfunc2(ident_reply *i, void *arg):
+cdef void _identfunc(ident_reply *i, void *arg):
   cdef SelIdentify id
   id = <SelIdentify>arg
   id._dead()
@@ -167,9 +167,5 @@ cdef void _identfunc2(ident_reply *i, void *arg):
     id.error(i.u.error)
   elif i.type == IDENT_USERID:
     id.user(i.u.userid.os, i.u.userid.user)
-cdef void _identfunc(ident_reply *i, void *arg):
-  PyEval_AcquireLock()
-  _identfunc2(i, arg)
-  PyEval_ReleaseLock()
 
 #----- That's all, folks ----------------------------------------------------