diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-03-01 16:12:04 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-03-01 16:12:04 +0100 |
commit | 0f35787993e38df5155d8459cd735960a4e4f20e (patch) | |
tree | 6a4dba056ee54dbf62b23c6f8f5470ab47fb7f5f /psutil/_pslinux.py | |
parent | a18641f6908047bba27c61b8ac450f0999c59d25 (diff) | |
parent | 170680a8e50d2af1f031499ebb55b0ce7c223c31 (diff) | |
download | psutil-779-proc-cpu-children-times.tar.gz |
Diffstat (limited to 'psutil/_pslinux.py')
-rw-r--r-- | psutil/_pslinux.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 50da9b53..0b996e70 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -180,13 +180,13 @@ def readlink(path): def file_flags_to_mode(flags): - md = {os.O_RDONLY: 'r', os.O_WRONLY: 'w', os.O_RDWR: 'w+'} - m = md[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] + modes_map = {os.O_RDONLY: 'r', os.O_WRONLY: 'w', os.O_RDWR: 'w+'} + mode = modes_map[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] if flags & os.O_APPEND: - m = m.replace('w', 'a', 1) - m = m.replace('w+', 'r+') + mode = mode.replace('w', 'a', 1) + mode = mode.replace('w+', 'r+') # possible values: r, w, a, r+, a+ - return m + return mode def get_sector_size(): |