[Bf-blender-cvs] [6b1bbcd3b03] master: Cleanup: use raw-strings for regex in console completion

Campbell Barton noreply at git.blender.org
Fri Oct 2 05:48:27 CEST 2020


Commit: 6b1bbcd3b03d0b5f18583e4d596bec13679f922b
Author: Campbell Barton
Date:   Fri Oct 2 10:16:06 2020 +1000
Branches: master
https://developer.blender.org/rB6b1bbcd3b03d0b5f18583e4d596bec13679f922b

Cleanup: use raw-strings for regex in console completion

===================================================================

M	release/scripts/modules/console/complete_calltip.py

===================================================================

diff --git a/release/scripts/modules/console/complete_calltip.py b/release/scripts/modules/console/complete_calltip.py
index 3404bb792fa..611be00b633 100644
--- a/release/scripts/modules/console/complete_calltip.py
+++ b/release/scripts/modules/console/complete_calltip.py
@@ -25,19 +25,19 @@ import re
 
 
 # regular expression constants
-DEF_DOC = '%s\s*(\(.*?\))'
-DEF_SOURCE = 'def\s+%s\s*(\(.*?\)):'
-RE_EMPTY_LINE = re.compile('^\s*\n')
+DEF_DOC = r'%s\s*(\(.*?\))'
+DEF_SOURCE = r'def\s+%s\s*(\(.*?\)):'
+RE_EMPTY_LINE = re.compile(r'^\s*\n')
 RE_FLAG = re.MULTILINE | re.DOTALL
 RE_NEWLINE = re.compile('\n+')
-RE_SPACE = re.compile('\s+')
+RE_SPACE = re.compile(r'\s+')
 RE_DEF_COMPLETE = re.compile(
     # don't start with a quote
     '''(?:^|[^"'a-zA-Z0-9_])'''
     # start with a \w = [a-zA-Z0-9_]
-    '''((\w+'''
+    r'''((\w+'''
     # allow also dots and closed bracket pairs []
-    '''(?:\w|[.]|\[.+?\])*'''
+    r'''(?:\w|[.]|\[.+?\])*'''
     # allow empty string
     '''|)'''
     # allow opening bracket(s)



More information about the Bf-blender-cvs mailing list