diff options
author | Kian-Meng Ang <kianmeng@cpan.org> | 2022-01-27 08:26:28 +0800 |
---|---|---|
committer | Kian-Meng Ang <kianmeng@cpan.org> | 2022-01-27 08:26:28 +0800 |
commit | 471b19d2aa799cd73bded23379e864dd35bec2b6 (patch) | |
tree | 26edd4638ab349b8c685aa645fbd9fb522e0cd89 /psutil | |
parent | f716afc81d4c9ded08b23d376612e1491d3ea5da (diff) | |
download | psutil-471b19d2aa799cd73bded23379e864dd35bec2b6.tar.gz |
Fix typos
Diffstat (limited to 'psutil')
-rw-r--r-- | psutil/__init__.py | 6 | ||||
-rw-r--r-- | psutil/_pslinux.py | 8 | ||||
-rw-r--r-- | psutil/_psutil_common.c | 2 | ||||
-rw-r--r-- | psutil/_psutil_sunos.c | 6 | ||||
-rw-r--r-- | psutil/_pswindows.py | 2 | ||||
-rw-r--r-- | psutil/arch/freebsd/sensors.c | 2 | ||||
-rw-r--r-- | psutil/arch/osx/cpu.c | 2 | ||||
-rw-r--r-- | psutil/arch/solaris/environ.c | 8 | ||||
-rw-r--r-- | psutil/arch/solaris/v10/ifaddrs.c | 2 | ||||
-rw-r--r-- | psutil/arch/windows/cpu.c | 6 | ||||
-rw-r--r-- | psutil/arch/windows/process_utils.c | 2 | ||||
-rw-r--r-- | psutil/tests/__init__.py | 4 | ||||
-rwxr-xr-x | psutil/tests/test_bsd.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_linux.py | 4 | ||||
-rwxr-xr-x | psutil/tests/test_process.py | 4 | ||||
-rwxr-xr-x | psutil/tests/test_system.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_windows.py | 2 |
17 files changed, 32 insertions, 32 deletions
diff --git a/psutil/__init__.py b/psutil/__init__.py index 6deebb26..db63fdbb 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -373,7 +373,7 @@ class Process(object): raise NoSuchProcess(pid, msg='process PID not found') else: self._gone = True - # This pair is supposed to indentify a Process instance + # This pair is supposed to identify a Process instance # univocally over time (the PID alone is not enough as # it might refer to a process whose PID has been reused). # This will be used later in __eq__() and is_running(). @@ -1054,7 +1054,7 @@ class Process(object): """Return a namedtuple with variable fields depending on the platform, representing memory information about the process. - The "portable" fields available on all plaforms are `rss` and `vms`. + The "portable" fields available on all platforms are `rss` and `vms`. All numbers are expressed in bytes. """ @@ -1208,7 +1208,7 @@ class Process(object): def suspend(self): """Suspend process execution with SIGSTOP pre-emptively checking whether PID has been reused. - On Windows this has the effect ot suspending all process threads. + On Windows this has the effect of suspending all process threads. """ if POSIX: self._send_signal(signal.SIGSTOP) diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 5f149a03..8549b525 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -242,7 +242,7 @@ def is_storage_device(name): "nvme0n1p1"). If name is a virtual device (e.g. "loop1", "ram") return True. """ - # Readapted from iostat source code, see: + # Re-adapted from iostat source code, see: # https://github.com/sysstat/sysstat/blob/ # 97912938cd476645b267280069e83b1c8dc0e1c7/common.c#L208 # Some devices may have a slash in their name (e.g. cciss/c0d0...). @@ -915,7 +915,7 @@ class Connections: # # out if there are multiple references to the # # same inode. We won't do this for UNIX sockets. # if len(inodes[inode]) > 1 and family != socket.AF_UNIX: - # raise ValueError("ambiguos inode with multiple " + # raise ValueError("ambiguous inode with multiple " # "PIDs references") pid, fd = inodes[inode][0] else: @@ -1675,7 +1675,7 @@ class Process(object): """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. @@ -1683,7 +1683,7 @@ class Process(object): data = bcat("%s/%s/stat" % (self._procfs_path, self.pid)) # Process name is between parentheses. It can contain spaces and # other parentheses. This is taken into account by looking for - # the first occurrence of "(" and the last occurence of ")". + # the first occurrence of "(" and the last occurrence of ")". rpar = data.rfind(b')') name = data[data.find(b'(') + 1:rpar] fields = data[rpar + 2:].split() diff --git a/psutil/_psutil_common.c b/psutil/_psutil_common.c index 9679da67..096e2f37 100644 --- a/psutil/_psutil_common.c +++ b/psutil/_psutil_common.c @@ -319,7 +319,7 @@ psutil_loadlibs() { // minimum requirement: Win 7 GetActiveProcessorCount = psutil_GetProcAddress( "kernel32", "GetActiveProcessorCount"); - // minumum requirement: Win 7 + // minimum requirement: Win 7 GetLogicalProcessorInformationEx = psutil_GetProcAddressFromLib( "kernel32", "GetLogicalProcessorInformationEx"); // minimum requirements: Windows Server Core diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c index 42a1ffe8..84bf1c40 100644 --- a/psutil/_psutil_sunos.c +++ b/psutil/_psutil_sunos.c @@ -124,7 +124,7 @@ psutil_proc_basic_info(PyObject *self, PyObject *args) { } /* - * Join array of C strings to C string with delemiter dm. + * Join array of C strings to C string with delimiter dm. * Omit empty records. */ static int @@ -1255,7 +1255,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { lport = tp.tcpConnLocalPort; rport = tp.tcpConnRemPort; - // contruct python tuple/list + // construct python tuple/list py_laddr = Py_BuildValue("(si)", lip, lport); if (!py_laddr) goto error; @@ -1300,7 +1300,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { lport = tp6.tcp6ConnLocalPort; rport = tp6.tcp6ConnRemPort; - // contruct python tuple/list + // construct python tuple/list py_laddr = Py_BuildValue("(si)", lip, lport); if (!py_laddr) goto error; diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 9966b1b4..31edffc1 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/freebsd/sensors.c b/psutil/arch/freebsd/sensors.c index ce7b2d92..0042adbe 100644 --- a/psutil/arch/freebsd/sensors.c +++ b/psutil/arch/freebsd/sensors.c @@ -64,7 +64,7 @@ psutil_sensors_cpu_temperature(PyObject *self, PyObject *args) { goto error; current = DECIKELVIN_2_CELCIUS(current); - // Return -273 in case of faliure. + // Return -273 in case of failure. sprintf(sensor, "dev.cpu.%d.coretemp.tjmax", core); if (sysctlbyname(sensor, &tjmax, &size, NULL, 0)) tjmax = 0; diff --git a/psutil/arch/osx/cpu.c b/psutil/arch/osx/cpu.c index 37141a2d..2d94f31d 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/environ.c b/psutil/arch/solaris/environ.c index 482fe1fc..58afd63a 100644 --- a/psutil/arch/solaris/environ.c +++ b/psutil/arch/solaris/environ.c @@ -227,7 +227,7 @@ is_ptr_dereference_possible(psinfo_t info) { /* * Return pointer size according to psinfo_t structure - * @param info a ponter to process info (psinfo_t) structure of the + * @param info a pointer to process info (psinfo_t) structure of the * interesting process. * @return pointer size (4 or 8). */ @@ -284,9 +284,9 @@ search_pointers_vector_size_offt(int fd, off_t offt, size_t ptr_size) { /* - * Derefence and read array of strings by psinfo_t.pr_argv pointer from + * Dereference and read array of strings by psinfo_t.pr_argv pointer from * remote process. - * @param info a ponter to process info (psinfo_t) structure of the + * @param info a pointer to process info (psinfo_t) structure of the * interesting process * @param procfs_path a cstring with path to mounted procfs filesystem. * @param count a pointer to variable where to store amount of elements in @@ -333,7 +333,7 @@ psutil_read_raw_args(psinfo_t info, const char *procfs_path, size_t *count) { /* * Dereference and read array of strings by psinfo_t.pr_envp pointer * from remote process. - * @param info a ponter to process info (psinfo_t) structure of the + * @param info a pointer to process info (psinfo_t) structure of the * interesting process. * @param procfs_path a cstring with path to mounted procfs filesystem. * @param count a pointer to variable where to store amount of elements in diff --git a/psutil/arch/solaris/v10/ifaddrs.c b/psutil/arch/solaris/v10/ifaddrs.c index b741a6b9..3719c8c1 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/cpu.c b/psutil/arch/windows/cpu.c index 20c01a0d..9d89e5bb 100644 --- a/psutil/arch/windows/cpu.c +++ b/psutil/arch/windows/cpu.c @@ -100,7 +100,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) { goto error; } - // gets cpu time informations + // gets cpu time information status = NtQuerySystemInformation( SystemProcessorPerformanceInformation, sppi, @@ -172,7 +172,7 @@ psutil_cpu_count_logical(PyObject *self, PyObject *args) { if (ncpus != 0) return Py_BuildValue("I", ncpus); else - Py_RETURN_NONE; // mimick os.cpu_count() + Py_RETURN_NONE; // mimic os.cpu_count() } @@ -248,7 +248,7 @@ psutil_cpu_count_cores(PyObject *self, PyObject *args) { } else { psutil_debug("GetLogicalProcessorInformationEx() count was 0"); - Py_RETURN_NONE; // mimick os.cpu_count() + Py_RETURN_NONE; // mimic os.cpu_count() } return_none: diff --git a/psutil/arch/windows/process_utils.c b/psutil/arch/windows/process_utils.c index acbda301..f9d4bbc8 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/__init__.py b/psutil/tests/__init__.py index 21bb3e61..b4ab6531 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -311,7 +311,7 @@ def spawn_testproc(cmd=None, **kwds): return it as a subprocess.Popen instance. If "cmd" is specified that is used instead of python. By default stdin and stdout are redirected to /dev/null. - It also attemps to make sure the process is in a reasonably + It also attempts to make sure the process is in a reasonably initialized state. The process is registered for cleanup on reap_children(). """ @@ -566,7 +566,7 @@ def reap_children(recursive=False): """Terminate and wait() any subprocess started by this test suite and any children currently running, ensuring that no processes stick around to hog resources. - If resursive is True it also tries to terminate and wait() + If recursive is True it also tries to terminate and wait() all grandchildren started by this process. """ # Get the children here before terminating them, as in case of diff --git a/psutil/tests/test_bsd.py b/psutil/tests/test_bsd.py index 1ae810f1..8d892310 100755 --- a/psutil/tests/test_bsd.py +++ b/psutil/tests/test_bsd.py @@ -115,7 +115,7 @@ class BSDTestCase(PsutilTestCase): dev, total, used, free = df(part.mountpoint) self.assertEqual(part.device, dev) self.assertEqual(usage.total, total) - # 10 MB tollerance + # 10 MB tolerance if abs(usage.free - free) > 10 * 1024 * 1024: raise self.fail("psutil=%s, df=%s" % (usage.free, free)) if abs(usage.used - used) > 10 * 1024 * 1024: diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index e36fb874..14553cd6 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -698,8 +698,8 @@ class TestSystemCPUCountLogical(PsutilTestCase): self.assertEqual(psutil._pslinux.cpu_count_logical(), original) assert m.called - # Let's have open() return emtpy data and make sure None is - # returned ('cause we mimick os.cpu_count()). + # Let's have open() return empty data and make sure None is + # returned ('cause we mimic os.cpu_count()). with mock.patch('psutil._common.open', create=True) as m: self.assertIsNone(psutil._pslinux.cpu_count_logical()) self.assertEqual(m.call_count, 2) diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index 2a2af93c..1be27ef2 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -700,7 +700,7 @@ class TestProcess(PsutilTestCase): self.assertEqual(exe.replace(ver, ''), PYTHON_EXE.replace(ver, '')) except AssertionError: - # Tipically MACOS. Really not sure what to do here. + # Typically MACOS. Really not sure what to do here. pass out = sh([exe, "-c", "import os; print('hey')"]) @@ -1518,7 +1518,7 @@ class TestPopen(PsutilTestCase): def test_misc(self): # XXX this test causes a ResourceWarning on Python 3 because - # psutil.__subproc instance doesn't get propertly freed. + # psutil.__subproc instance doesn't get properly freed. # Not sure what to do though. cmd = [PYTHON_EXE, "-c", "import time; time.sleep(60);"] with psutil.Popen(cmd, stdout=subprocess.PIPE, diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index ed328d01..bb5edd5c 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -510,7 +510,7 @@ class TestCpuAPIs(PsutilTestCase): 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: diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index 55b6bc7b..4aa25184 100755 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -166,7 +166,7 @@ class TestSystemAPIs(WindowsTestCase): self.assertEqual(usage.total, int(wmi_part.Size)) wmi_free = int(wmi_part.FreeSpace) self.assertEqual(usage.free, wmi_free) - # 10 MB tollerance + # 10 MB tolerance if abs(usage.free - wmi_free) > 10 * 1024 * 1024: raise self.fail("psutil=%s, wmi=%s" % ( usage.free, wmi_free)) |