diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-10 10:41:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-10 10:41:23 +0000 |
commit | 893624422823fafc2d76eab2a1ca4e1ae4b4ab5b (patch) | |
tree | 54a2f053baeafcf697834becd2c184de09626f94 /pym/portage | |
parent | 89144152673ec6d4c52d509d03781a4132f9303c (diff) | |
download | portage-893624422823fafc2d76eab2a1ca4e1ae4b4ab5b.tar.gz portage-893624422823fafc2d76eab2a1ca4e1ae4b4ab5b.tar.bz2 portage-893624422823fafc2d76eab2a1ca4e1ae4b4ab5b.zip |
Bug #288025 - Avoid AttributeError on OSes that don't have os.statvfs.
svn path=/main/trunk/; revision=14553
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 94c698cc5..299615c4f 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -258,10 +258,12 @@ _os_overrides = { id(_os.fdopen) : _os.fdopen, id(_os.popen) : _os.popen, id(_os.read) : _os.read, - id(_os.statvfs) : _os.statvfs, id(_os.system) : _os.system, } +if hasattr(_os, 'statvfs'): + _os_overrides[id(_os.statvfs)] = _os.statvfs + os = _unicode_module_wrapper(_os, overrides=_os_overrides, encoding=_encodings['fs']) _os_merge = _unicode_module_wrapper(_os, |