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 --- psutil/_pswindows.py | 2 +- psutil/arch/freebsd/sensors.c | 6 +++--- psutil/tests/test_connections.py | 2 +- psutil/tests/test_windows.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'psutil') 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 -- cgit v1.2.1