aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2024-11-27 14:19:53 +0100
committerVratko Polak <vrpolak@cisco.com>2024-11-27 13:33:25 +0000
commit8af0b58f5ea9e8cc33ffaf73b442cdd2e13a7621 (patch)
tree9ab1b0549931c8cbe90e8234a2294b7469dbd2e4 /resources/libraries/python
parent64e0f7f310c4267b8d3ec5b92218086bffd0d3f1 (diff)
fix(pylint): Escape backslash properly
When backslach is used to escape Robot dollar or docstring asterisk, and the backslash is in normal (not raw) Python (doc)string, the backslash itself needs to be escaped by a second backslash. The old code happened to work well enough, but now it leads to a loud SyntaxWarning in console log, so it is worth fixing faster than other pylint violations. Change-Id: Id36fa0a393267f2cdced1229a30eaff8357c4ac4 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/CpuUtils.py4
-rw-r--r--resources/libraries/python/autogen/Regenerator.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py
index 518469bd31..c573417fca 100644
--- a/resources/libraries/python/CpuUtils.py
+++ b/resources/libraries/python/CpuUtils.py
@@ -248,7 +248,7 @@ class CpuUtils:
computing unit is physical core count.
On SMT enabled DUTs, both sibling logical cores are used,
- unless Robot variable \${smt_used} is set to False.
+ unless Robot variable \\${smt_used} is set to False.
:param node: DUT node.
:param cpu_node: Numa node number.
@@ -281,7 +281,7 @@ class CpuUtils:
raise RuntimeError(u"NodeID is out of range!")
smt_used = CpuUtils.is_smt_enabled(node[u"cpuinfo"])
- smt_used = BuiltIn().get_variable_value("\${smt_used}", smt_used)
+ smt_used = BuiltIn().get_variable_value("\\${smt_used}", smt_used)
cpu_list = CpuUtils.cpu_list_per_node(node, cpu_node, smt_used)
# CPU thread sibling offset.
sib = len(cpu_list) // CpuUtils.NR_OF_THREADS
diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py
index ce8f21d4b6..69cacbdb27 100644
--- a/resources/libraries/python/autogen/Regenerator.py
+++ b/resources/libraries/python/autogen/Regenerator.py
@@ -720,7 +720,7 @@ class Regenerator:
Log-like prints are emitted to sys.stderr.
- :param pattern: Glob pattern to select files. Example: \*-ndrpdr.robot
+ :param pattern: Glob pattern to select files. Example: \\*-ndrpdr.robot
:param protocol: String determining minimal frame size. Default: "ip4"
:type pattern: str
:type protocol: str