summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-10 10:44:49 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-10 10:44:49 +0000
commita7031b1465a483211dcec191b02a78f819ed8230 (patch)
tree5b0630f5245dad19cc7e81e9ffb94839673fa405
parentRevert the rest of the package sets related code and docs, to behave like the (diff)
downloadportage-a7031b1465a483211dcec191b02a78f819ed8230.tar.gz
portage-a7031b1465a483211dcec191b02a78f819ed8230.tar.bz2
portage-a7031b1465a483211dcec191b02a78f819ed8230.zip
Bug #288025 - Avoid AttributeError on OSes that don't have os.statvfs.
(trunk r14553) svn path=/main/branches/2.1.7/; revision=14554
-rw-r--r--pym/portage/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 8bc8bcc08..ec92d6b83 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,