Skip to content

Commit 58d250f

Browse files
committed
Maya Python3 Support: use raw strings for regex patterns
1 parent 5b86017 commit 58d250f

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎python/IECoreMaya/DAGPathParameter.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __getattr__( self, attrName ):
9292
"""
9393
@staticmethod
9494
def pathValidator():
95-
return re.compile( "^(\|?[^\t\n\r\f\v\|]+)+\|?$" )
95+
return re.compile( r"^(|?[^\t\n\r\f\v|]+)+\|?$" )
9696

9797
"""
9898
Returns (True, "") only if the value is a correct DAG path string and also checks that the DAG node exists or doesn't exist

‎python/IECoreMaya/FnDagNode.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def defaultShapeName( transformNode ):
115115

116116
parentShort = transformNode.rpartition( "|" )[-1]
117117

118-
numbersMatch = re.search( "[0-9]+$", parentShort )
118+
numbersMatch = re.search( r"[0-9]+$", parentShort )
119119
if numbersMatch is not None :
120120
numbers = numbersMatch.group()
121121
shapeName = parentShort[:-len(numbers)] + "Shape" + numbers

‎python/IECoreMaya/FnSceneShape.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def create( parentName, transformParent = None, shadingEngine = None ) :
9797
@IECoreMaya.UndoFlush()
9898
def createShape( parentNode, shadingEngine = None ) :
9999
parentShort = parentNode.rpartition( "|" )[-1]
100-
numbersMatch = re.search( "[0-9]+$", parentShort )
100+
numbersMatch = re.search( r"[0-9]+$", parentShort )
101101
if numbersMatch is not None :
102102
numbers = numbersMatch.group()
103103
shapeName = parentShort[:-len(numbers)] + "SceneShape" + numbers

‎python/IECoreMaya/NodeParameter.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __getattr__( self, attrName ):
9191
"""
9292
@staticmethod
9393
def pathValidator():
94-
return re.compile( "^(\|?[^\t\n\r\f\v\|]+)+\|?$" )
94+
return re.compile( r"^(|?[^\t\n\r\f\v|]+)+\|?$" )
9595

9696
"""
9797
Returns (True, "") only if the value is a correct dependency nodestring and also checks that the node exists or doesn't exist

‎python/IECoreMaya/SplineParameterUI.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __openEditWindow( self, unused ) :
9191

9292
if not self.__editWindow :
9393

94-
editWindowName = re.sub( "[\|\.]" , "_", self.plugName() )
94+
editWindowName = re.sub( r"[|.]" , "_", self.plugName() )
9595
if maya.cmds.window( editWindowName, q=True, exists=True ):
9696
maya.cmds.deleteUI( editWindowName )
9797

‎python/IECoreMaya/StringUtil.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ def pathFromPlug( p ) :
105105
## Extracts the node name from a full path to an attribute.
106106
def nodeFromAttributePath( a ) :
107107

108-
return re.match( "^[^.]*", a ).group( 0 )
108+
return re.match( r"^[^.]*", a ).group( 0 )

0 commit comments

Comments
 (0)