diff options
Diffstat (limited to 'python/progress.cc')
| -rw-r--r-- | python/progress.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/progress.cc b/python/progress.cc index 5267134f..12f9c7a8 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -244,9 +244,13 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) #endif if (child_id == 0) { PyObject *v = PyObject_GetAttrString(callbackInst, "writefd"); - int fd = PyObject_AsFileDescriptor(v); - cout << "got fd: " << fd << endl; - res = pm->DoInstall(fd); + if(v) { + int fd = PyObject_AsFileDescriptor(v); + cout << "got fd: " << fd << endl; + res = pm->DoInstall(fd); + } else { + res = pm->DoInstall(); + } _exit(res); } |
