From 446f4bfed1463f9016cf6bdd36f6b30700bec0ad Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 15 Mar 2022 17:17:00 +0800 Subject: [PATCH] fix some typos (#2085) Signed-off-by: cuishuang --- docs/DEVGUIDE.rst | 2 +- docs/index.rst | 6 +++--- make.bat | 2 +- psutil/_pslinux.py | 2 +- psutil/_pswindows.py | 2 +- psutil/arch/osx/cpu.c | 2 +- psutil/arch/solaris/v10/ifaddrs.c | 2 +- psutil/arch/windows/process_utils.c | 2 +- psutil/tests/test_linux.py | 2 +- psutil/tests/test_system.py | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/DEVGUIDE.rst b/docs/DEVGUIDE.rst index cb9545bcf..d4e6778f2 100644 --- a/docs/DEVGUIDE.rst +++ b/docs/DEVGUIDE.rst @@ -115,7 +115,7 @@ Unit tests are automatically run on every ``git push`` on **Linux**, **macOS**, .. image:: https://img.shields.io/appveyor/ci/giampaolo/psutil/master.svg?maxAge=3600&label=Windows :target: https://ci.appveyor.com/project/giampaolo/psutil -OpenBSD, NetBSD, AIX and Solaris does not have continuos test integration. +OpenBSD, NetBSD, AIX and Solaris does not have continuous test integration. Documentation ------------- diff --git a/docs/index.rst b/docs/index.rst index 595aafb2d..82872a2b5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1101,7 +1101,7 @@ Process class Here's a list of methods which can take advantage of the speedup depending on what platform you're on. - In the table below horizontal emtpy rows indicate what process methods can + In the table below horizontal empty rows indicate what process methods can be efficiently grouped together internally. The last column (speedup) shows an approximation of the speedup you can get if you call all the methods together (best case scenario). @@ -1194,8 +1194,8 @@ Process class .. versionadded:: 4.0.0 .. versionchanged:: 5.3.0 added SunOS support - .. versionchanged:: 5.6.3 added AIX suport - .. versionchanged:: 5.7.3 added BSD suport + .. versionchanged:: 5.6.3 added AIX support + .. versionchanged:: 5.7.3 added BSD support .. method:: create_time() diff --git a/make.bat b/make.bat index 8e60811cc..e292bb16b 100644 --- a/make.bat +++ b/make.bat @@ -2,7 +2,7 @@ rem ========================================================================== rem Shortcuts for various tasks, emulating UNIX "make" on Windows. -rem It is primarly intended as a shortcut for compiling / installing +rem It is primarily intended as a shortcut for compiling / installing rem psutil ("make.bat build", "make.bat install") and running tests rem ("make.bat test"). rem diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 5f149a035..afcb78f55 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1675,7 +1675,7 @@ def _parse_stat_file(self): """Parse /proc/{pid}/stat file and return a dict with various process info. Using "man proc" as a reference: where "man proc" refers to - position N always substract 3 (e.g ppid position 4 in + position N always subtract 3 (e.g ppid position 4 in 'man proc' == position 1 in here). The return value is cached in case oneshot() ctx manager is in use. diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 9966b1b4e..31edffc1c 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -249,7 +249,7 @@ def swap_memory(): free_system = mem[3] # Despite the name PageFile refers to total system memory here - # thus physical memory values need to be substracted to get swap values + # thus physical memory values need to be subtracted to get swap values total = total_system - total_phys free = min(total, free_system - free_phys) used = total - free diff --git a/psutil/arch/osx/cpu.c b/psutil/arch/osx/cpu.c index 37141a2d3..2d94f31dd 100644 --- a/psutil/arch/osx/cpu.c +++ b/psutil/arch/osx/cpu.c @@ -119,7 +119,7 @@ psutil_cpu_freq(PyObject *self, PyObject *args) { size_t len = sizeof(curr); size_t size = sizeof(min); - // also availble as "hw.cpufrequency" but it's deprecated + // also available as "hw.cpufrequency" but it's deprecated mib[0] = CTL_HW; mib[1] = HW_CPU_FREQ; diff --git a/psutil/arch/solaris/v10/ifaddrs.c b/psutil/arch/solaris/v10/ifaddrs.c index b741a6b92..3719c8c18 100644 --- a/psutil/arch/solaris/v10/ifaddrs.c +++ b/psutil/arch/solaris/v10/ifaddrs.c @@ -1,4 +1,4 @@ -/* Refrences: +/* References: * https://lists.samba.org/archive/samba-technical/2009-February/063079.html * http://stackoverflow.com/questions/4139405/#4139811 * https://github.com/steve-o/openpgm/blob/master/openpgm/pgm/getifaddrs.c diff --git a/psutil/arch/windows/process_utils.c b/psutil/arch/windows/process_utils.c index acbda301a..f9d4bbc8a 100644 --- a/psutil/arch/windows/process_utils.c +++ b/psutil/arch/windows/process_utils.c @@ -160,7 +160,7 @@ psutil_handle_from_pid(DWORD pid, DWORD access) { } -// Check for PID existance. Return 1 if pid exists, 0 if not, -1 on error. +// Check for PID existence. Return 1 if pid exists, 0 if not, -1 on error. int psutil_pid_is_running(DWORD pid) { HANDLE hProcess; diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index e36fb8745..0e6c1fd70 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -698,7 +698,7 @@ def test_emulate_fallbacks(self): self.assertEqual(psutil._pslinux.cpu_count_logical(), original) assert m.called - # Let's have open() return emtpy data and make sure None is + # Let's have open() return empty data and make sure None is # returned ('cause we mimick os.cpu_count()). with mock.patch('psutil._common.open', create=True) as m: self.assertIsNone(psutil._pslinux.cpu_count_logical()) diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index ed328d017..bb5edd5c3 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -510,7 +510,7 @@ def test_cpu_stats(self): if not AIX and name in ('ctx_switches', 'interrupts'): self.assertGreater(value, 0) - @unittest.skipIf(not HAS_CPU_FREQ, "not suported") + @unittest.skipIf(not HAS_CPU_FREQ, "not supported") def test_cpu_freq(self): def check_ls(ls): for nt in ls: