Fix syntax warning when using python >=3.12
Resolves: RHEL-97825 Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
parent
f79b863124
commit
e2df7a9506
31
rteval-services.py-Fix-SyntaxWarning.patch
Normal file
31
rteval-services.py-Fix-SyntaxWarning.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From e874cc3f757bae50e74af461529179048c1eb4a7 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Wed, 4 Jun 2025 13:38:51 -0400
|
||||
Subject: [PATCH 1/2] rteval: services.py: Fix SyntaxWarning
|
||||
|
||||
In services.py we get a SyntaxWarning: invalid escape sequence '\('
|
||||
using python >= 3.12
|
||||
|
||||
Fix this by using a raw string.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
rteval/sysinfo/services.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/rteval/sysinfo/services.py b/rteval/sysinfo/services.py
|
||||
index e98017804841..c3c155354e07 100644
|
||||
--- a/rteval/sysinfo/services.py
|
||||
+++ b/rteval/sysinfo/services.py
|
||||
@@ -42,7 +42,7 @@ class SystemServices:
|
||||
servicename = os.path.basename(service)
|
||||
if not [1 for p in reject if fnmatch.fnmatch(servicename, p)] \
|
||||
and os.access(service, os.X_OK):
|
||||
- cmd = f'{getcmdpath("grep")} -qs "\(^\|\W\)status)" {service}'
|
||||
+ cmd = fr'{getcmdpath("grep")} -qs "\(^\|\W\)status)" {service}'
|
||||
c = subprocess.Popen(cmd, shell=True, encoding='utf-8')
|
||||
c.wait()
|
||||
if c.returncode == 0:
|
||||
--
|
||||
2.49.0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user