summaryrefslogtreecommitdiff
path: root/python/progress.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/progress.cc')
-rw-r--r--python/progress.cc10
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);
}