]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
doc/scripts: use raw string for regex in gen_state_diagram.py 68606/head
authorKefu Chai <k.chai@proxmox.com>
Fri, 24 Apr 2026 13:34:43 +0000 (21:34 +0800)
committerKefu Chai <k.chai@proxmox.com>
Fri, 24 Apr 2026 13:37:59 +0000 (21:37 +0800)
commit2178a1aa771e07457e542da3de29e11de061a7e6
tree66784952764ff9bb484f81be3593796e3bb5ec85
parent5c651b65f21240e7ccfee7f21ea40ef9e653cf6b
doc/scripts: use raw string for regex in gen_state_diagram.py

Python 3.12 emits SyntaxWarning for invalid escape sequences in ordinary
string literals. The re.search() call on line 162 was the only pattern
in the file passed as a non-raw string, causing:

  doc/scripts/gen_state_diagram.py:162: SyntaxWarning: invalid escape
    sequence '\s'
    i = re.search("return\s+transit<\s*(\w*)\s*>()", line)

Add the r"" prefix to match the other re.search / re.finditer / re.sub
call sites in the same file. No behavior change; \s was already being
interpreted as a regex whitespace class because Python leaves unknown
escapes untouched, but this will become a SyntaxError in a future
Python release.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
doc/scripts/gen_state_diagram.py