diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-10-21 19:59:51 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-10-21 19:59:51 +0000 |
| commit | bd6df1d8419eb3403e64191681b32fbd1f3accac (patch) | |
| tree | d2a0ebed225e24207c952430390a51d3628a03fb /python/progress.cc | |
| parent | dbab2dd1c1360837ebd524bcc1bb378534210426 (diff) | |
| download | python-apt-bd6df1d8419eb3403e64191681b32fbd1f3accac.tar.gz | |
* fix a crasher in the install interface
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); } |
