summaryrefslogtreecommitdiff
path: root/psutil
diff options
context:
space:
mode:
authorcui fliter <imcusg@gmail.com>2023-05-09 18:03:08 +0800
committerGitHub <noreply@github.com>2023-05-09 12:03:08 +0200
commit49aba759744c06fb3a6fa998155428520f161734 (patch)
tree5cad6acc4ff6adac01ec756a4c9baa89d45f5c0f /psutil
parent5c52826e7eac9648006392f5d491f6fdf6ff50a8 (diff)
downloadpsutil-49aba759744c06fb3a6fa998155428520f161734.tar.gz
fix typos and some other minor bugs (#2253)HEADmaster
Signed-off-by: cui fliter <imcusg@gmail.com>
Diffstat (limited to 'psutil')
-rw-r--r--psutil/_pswindows.py2
-rw-r--r--psutil/arch/freebsd/sensors.c6
-rwxr-xr-xpsutil/tests/test_connections.py2
-rwxr-xr-xpsutil/tests/test_windows.py4
4 files changed, 7 insertions, 7 deletions
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, &current, &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