1 6 package org.python.core; 7 8 9 15 16 public class PyFinalizableInstance extends PyInstance 17 { 18 public PyFinalizableInstance(PyClass iclass) { 19 super(iclass); 20 } 21 22 protected void finalize() { 24 try { 25 instclass.__del__.__call__(this); 26 } catch (PyException exc) { 27 PyObject method = instclass.__del__; 29 try { 30 method = __findattr__("__del__"); 31 } catch (PyException e) { ; } 32 33 Py.stderr.println("Exception " + 34 Py.formatException(exc.type, exc.value, exc.traceback) + 35 " in " + method + 36 " ignored"); 37 } 38 } 39 } 40 | Popular Tags |