smihica / pyminizip

To create a password encrypted zip file in python.
Other
106 stars 37 forks source link

Allow for progress_cb_obj to be a callable or None #47

Open roddehugo opened 12 months ago

roddehugo commented 12 months ago

Check the progress object with PyCallable_Check which has the same signature than PyFunction_Check.

int PyFunction_Check(PyObject *o) Return true if o is a function object (has type PyFunction_Type). The parameter must not be NULL.

vs

int PyCallable_Check(PyObject *o) Determine if the object o is callable. Return 1 if the object is callable and 0 otherwise. This function always succeeds.

This commit closes https://github.com/smihica/pyminizip/issues/46