diff options
-rw-r--r-- | src/buildstream/utils.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buildstream/utils.py b/src/buildstream/utils.py index f509ce998..775a11142 100644 --- a/src/buildstream/utils.py +++ b/src/buildstream/utils.py @@ -642,12 +642,11 @@ def _get_dir_size(path): # def _get_volume_size(path): try: - stat_ = os.statvfs(path) + usage = shutil.disk_usage(path) except OSError as e: raise UtilError("Failed to retrieve stats on volume for path '{}': {}" .format(path, e)) from e - - return stat_.f_bsize * stat_.f_blocks, stat_.f_bsize * stat_.f_bavail + return usage.total, usage.free # _parse_size(): |