diff --git a/ilcsoft/cernlib.py b/ilcsoft/cernlib.py index 8b1e38bf..fb60da6a 100644 --- a/ilcsoft/cernlib.py +++ b/ilcsoft/cernlib.py @@ -183,7 +183,7 @@ def cleanupInstall(self): #os.chdir( self.installPath + "/build" ) ## delete object files - os_system( "find "+self.installPath + "/build -type f -name *.o -exec rm -f {} \;" ) + os_system( "find "+self.installPath + r"/build -type f -name *.o -exec rm -f {} \;" ) def postCheckDeps(self): BaseILC.postCheckDeps(self) diff --git a/ilcsoft/ilcsoft.py b/ilcsoft/ilcsoft.py index 5973d4bc..27a2113c 100644 --- a/ilcsoft/ilcsoft.py +++ b/ilcsoft/ilcsoft.py @@ -80,7 +80,7 @@ def __init__(self, installPath): #fg: release_string might be empty, e.g. if lsb_release does not exis (MacOs) self.release_number = '-1' if len( release_string ): - self.release_number = release_string[re.search('\d', release_string).start()] + self.release_number = release_string[re.search(r'\d', release_string).start()] for k,v in self.debugInfo.items(): print("+", k, '\t', str(v).replace("\n","\n\t\t")) diff --git a/ilcsoft/ninja.py b/ilcsoft/ninja.py index e275a39b..9c389020 100644 --- a/ilcsoft/ninja.py +++ b/ilcsoft/ninja.py @@ -54,7 +54,7 @@ def compile(self): def cleanupInstall(self): BaseILC.cleanupInstall(self) os.chdir( self.installPath ) - os_system( "find . \! -name 'ninja' -delete" ) + os_system( r"find . \! -name 'ninja' -delete" ) def postCheckDeps(self): BaseILC.postCheckDeps(self) diff --git a/scripts/tagging/parseversion.py b/scripts/tagging/parseversion.py index 3b63cb40..a5b6e385 100644 --- a/scripts/tagging/parseversion.py +++ b/scripts/tagging/parseversion.py @@ -57,7 +57,7 @@ def _parseVersion( self ): elif 'pre' in parts[2]: self.pre = int(parts[2].strip('pre')) else: - self.patch = int( parts[2] ) + self.patch = int( parts[2].strip('p') ) if len(parts) >= 4: if 'pre' == parts[3]: diff --git a/scripts/tests/Test_Tagging.py b/scripts/tests/Test_Tagging.py index 4aea4b8c..24a8c62f 100644 --- a/scripts/tests/Test_Tagging.py +++ b/scripts/tests/Test_Tagging.py @@ -211,7 +211,7 @@ def test_ctor_fail_1( self ): } ] - with self.assertRaisesRegexp( RuntimeError, "Invalid version required"), \ + with self.assertRaisesRegex( RuntimeError, "Invalid version required"), \ patch( "tagging.gitinterface.Repo.getGithubTags", new=Mock( return_value=myTagInfo)): self.repo = Repo(owner="tester", repo="testrepo", branch="testbranch", newVersion="v01-03-20-pre", preRelease=True, dryRun=True) @@ -225,7 +225,7 @@ def test_ctor_fail_2( self ): "tarball_url": "tarball/v0.1" } ] - with self.assertRaisesRegexp( RuntimeError, "Invalid version required"), \ + with self.assertRaisesRegex( RuntimeError, "Invalid version required"), \ patch( "tagging.gitinterface.Repo.getGithubTags", new=Mock( return_value=myTagInfo)): self.repo = Repo(owner="tester", repo="testrepo", branch="testbranch", newVersion="v01-03-19", preRelease=True, dryRun=True) @@ -241,7 +241,7 @@ def test_ctor_fail_3( self ): ] - with self.assertRaisesRegexp( RuntimeError, "Invalid version required"), \ + with self.assertRaisesRegex( RuntimeError, "Invalid version required"), \ patch( "tagging.gitinterface.Repo.getGithubTags", new=Mock( return_value=myTagInfo)): self.repo = Repo(owner="tester", repo="testrepo", branch="testbranch", newVersion="v01-03-20-pre1", preRelease=True, dryRun=True)