Skip to content

Commit 9b3a239

Browse files
committed
NodeSet: declare RegEx pattern as a raw string (#414)
Python 3 interprets string literals as Unicode strings. \D is treated as an unrecognized escape sequence and as such is left unchanged. from 2.4.1. String and Bytes literals: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals Changed in version 3.6: Unrecognized escape sequences produce a DeprecationWarning. In some future version of Python they will be a SyntaxError. Closes #414. Change-Id: I2f756a4647d740adb0bc35499fe869121993069f
1 parent 55c16ba commit 9b3a239

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClusterShell/NodeSet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def __init__(self, group_resolver, node_wildcard_enable=True):
790790
Initialize Parsing Engine.
791791
"""
792792
self.group_resolver = group_resolver
793-
self.base_node_re = re.compile("(\D*)(\d*)")
793+
self.base_node_re = re.compile(r"(\D*)(\d*)")
794794
self.node_wc = node_wildcard_enable # node wildcard support
795795

796796
def parse(self, nsobj, autostep):

0 commit comments

Comments
 (0)