Commits

Anonymous committed 7de2d0f

add dealloc

  • Participants
  • Parent commits 179ca2b

Comments (0)

Files changed (4)

     def __init__(self, ctor='new', *args):
         self._perl = self._get_perl()
         self.perl_name = '%(perl_name)s'
-        call_arg = (ctor, self.perl_name) 
+        call_arg = (ctor, self.perl_name) + args 
         self.ref = self._perl.call_method(*call_arg)
     
 
     perl_destruct(my_perl);
     perl_free(my_perl);
 	Py_TYPE(self)->tp_free(self);
+    //printf("dealloc \n");
 }
 
 static PyObject *
     PERL_SET_CONTEXT(my_perl);
     SvREFCNT_dec(self->sv);
 	Py_TYPE(self)->tp_free(self);
+    //printf("PySVRv dealloc\n");
 }
 
 
 	"ref",					/* tp_name */
 	sizeof(PySvRV_Object),				/* tp_basicsize */
 	0,						/* tp_itemsize */
-	0, /*(destructor)svrv_dealloc,*/			/* tp_dealloc */
+	(destructor)svrv_dealloc,			/* tp_dealloc */
 	0,						/* tp_print */
 	0,						/* tp_getattr */
 	0,						/* tp_setattr */

tests/test_perl.py

     ret = p.require("HTTP::Request")
     assert ret == 1
 
+def test_new():
+    p = Perl()
+    p.require("LWP::UserAgent")
+    ret = p.call_method("new", "LWP::UserAgent")
+    assert ret != 1
 
-def test_class():
-    p = Perl()
-    clz = p.perlclass("LWP::UserAgent")
-    assert clz.__name__ == "LWP_UserAgent"
 
-