From 49aba759744c06fb3a6fa998155428520f161734 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 9 May 2023 18:03:08 +0800 Subject: fix typos and some other minor bugs (#2253) Signed-off-by: cui fliter --- HISTORY.rst | 2 +- psutil/_pswindows.py | 2 +- psutil/arch/freebsd/sensors.c | 6 +++--- psutil/tests/test_connections.py | 2 +- psutil/tests/test_windows.py | 4 ++-- scripts/internal/check_broken_links.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 1a79b360..8a6b880d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -481,7 +481,7 @@ XXXX-XX-XX doesn't exist. (patch by Cedric Lamoriniere) - 1471_, [SunOS]: `Process.name()`_ and `Process.cmdline()`_ can return ``SystemError``. (patch by Daniel Beer) -- 1472_, [Linux]: `cpu_freq()`_ does not return all CPUs on Rasbperry-pi 3. +- 1472_, [Linux]: `cpu_freq()`_ does not return all CPUs on Raspberry-pi 3. - 1474_: fix formatting of ``psutil.tests()`` which mimics ``ps aux`` output. - 1475_, [Windows], **[critical]**: ``OSError.winerror`` attribute wasn't properly checked resulting in ``WindowsError(ERROR_ACCESS_DENIED)`` being diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 4081aa17..38e26ebc 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -247,7 +247,7 @@ def swap_memory(): total_system = mem[2] # system memory (commit total/limit) is the sum of physical and swap - # 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 # commit total is incremented immediately (decrementing free_system) # while the corresponding free physical value is not decremented until diff --git a/psutil/arch/freebsd/sensors.c b/psutil/arch/freebsd/sensors.c index 0042adbe..08a882dd 100644 --- a/psutil/arch/freebsd/sensors.c +++ b/psutil/arch/freebsd/sensors.c @@ -20,7 +20,7 @@ For reference, here's the git history with original(ish) implementations: #include "../../_psutil_posix.h" -#define DECIKELVIN_2_CELCIUS(t) (t - 2731) / 10 +#define DECIKELVIN_2_CELSIUS(t) (t - 2731) / 10 PyObject * @@ -62,13 +62,13 @@ psutil_sensors_cpu_temperature(PyObject *self, PyObject *args) { sprintf(sensor, "dev.cpu.%d.temperature", core); if (sysctlbyname(sensor, ¤t, &size, NULL, 0)) goto error; - current = DECIKELVIN_2_CELCIUS(current); + current = DECIKELVIN_2_CELSIUS(current); // Return -273 in case of failure. sprintf(sensor, "dev.cpu.%d.coretemp.tjmax", core); if (sysctlbyname(sensor, &tjmax, &size, NULL, 0)) tjmax = 0; - tjmax = DECIKELVIN_2_CELCIUS(tjmax); + tjmax = DECIKELVIN_2_CELSIUS(tjmax); return Py_BuildValue("ii", current, tjmax); diff --git a/psutil/tests/test_connections.py b/psutil/tests/test_connections.py index ad615ed0..aec164e8 100755 --- a/psutil/tests/test_connections.py +++ b/psutil/tests/test_connections.py @@ -200,7 +200,7 @@ class TestUnconnectedSockets(ConnectionTestCase): @serialrun class TestConnectedSocket(ConnectionTestCase): - """Test socket pairs which are are actually connected to + """Test socket pairs which are actually connected to each other. """ diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index a9f68933..dd1dcbb1 100755 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -65,7 +65,7 @@ class WindowsTestCase(PsutilTestCase): def powershell(cmd): - """Currently not used, but avalable just in case. Usage: + """Currently not used, but available just in case. Usage: >>> powershell( "Get-CIMInstance Win32_PageFileUsage | Select AllocatedBaseSize") @@ -79,7 +79,7 @@ def powershell(cmd): def wmic(path, what, converter=int): - """Currently not used, but avalable just in case. Usage: + """Currently not used, but available just in case. Usage: >>> wmic("Win32_OperatingSystem", "FreePhysicalMemory") 2134124534 diff --git a/scripts/internal/check_broken_links.py b/scripts/internal/check_broken_links.py index 8ceab1c7..f5375a86 100755 --- a/scripts/internal/check_broken_links.py +++ b/scripts/internal/check_broken_links.py @@ -25,7 +25,7 @@ Method: Handles redirects, http, https, ftp as well. REFERENCES: -Using [1] with some modificatons for including ftp +Using [1] with some modifications for including ftp [1] http://stackoverflow.com/a/6883094/5163807 [2] http://stackoverflow.com/a/31952097/5163807 [3] http://daringfireball.net/2010/07/improved_regex_for_matching_urls -- cgit v1.2.1