From 3c08055d8a1cc58db1af5c6a4e13bfeac36dbc50 Mon Sep 17 00:00:00 2001 From: Tobias Pfeiffer Date: Mon, 18 Nov 2019 10:09:03 +0900 Subject: [PATCH] fix escape sequences --- src/genmsg/names.py | 4 ++-- test/test_genmsg_msgs.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/genmsg/names.py b/src/genmsg/names.py index c0f3ef5..7818a9b 100644 --- a/src/genmsg/names.py +++ b/src/genmsg/names.py @@ -113,7 +113,7 @@ def package_resource_name(name): # NAME VALIDATORS #ascii char followed by (alphanumeric, _, /) -RESOURCE_NAME_LEGAL_CHARS_P = re.compile('^[A-Za-z][\w_\/]*$') +RESOURCE_NAME_LEGAL_CHARS_P = re.compile(r'^[A-Za-z][\w_\/]*$') def is_legal_resource_name(name): """ Check if name is a legal ROS name for filesystem resources @@ -131,7 +131,7 @@ def is_legal_resource_name(name): # '//' check makes sure there isn't double-slashes return m is not None and m.group(0) == name and not '//' in name -BASE_RESOURCE_NAME_LEGAL_CHARS_P = re.compile('^[A-Za-z][\w_]*$') #ascii char followed by (alphanumeric, _) +BASE_RESOURCE_NAME_LEGAL_CHARS_P = re.compile(r'^[A-Za-z][\w_]*$') #ascii char followed by (alphanumeric, _) def is_legal_resource_base_name(name): """ Validates that name is a legal resource base name. A base name has diff --git a/test/test_genmsg_msgs.py b/test/test_genmsg_msgs.py index 7d55cd5..6e25189 100644 --- a/test/test_genmsg_msgs.py +++ b/test/test_genmsg_msgs.py @@ -191,7 +191,7 @@ def sub_test_MsgSpec(types, names, constants, text, full_name, has_header): # types and names mismatch try: - MsgSpec(['int32', 'int32'], ['intval'], [], 'int32 intval\int32 y', 'x/Mismatch') + MsgSpec(['int32', 'int32'], ['intval'], [], 'int32 intval\nint32 y', 'x/Mismatch') assert False, "types and names must align" except: pass