From 6d4334e325f67586d97cb861ed18484286150eaf Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 22 Feb 2011 13:36:35 -0700 Subject: Fix improper use of strip() Strip doesn't do what I thought it did, it will remove any of the individual chars from the string, rather than just removing the substring from the string. replace('substring', '') needs to be used instead. --- src/pyfedpkg/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 0b00487..9d63c25 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1077,7 +1077,7 @@ class PackageModule: # Now check to see if it's an old style branch with /master elif re.match(OLDBRANCHRE, merge): # Trim off the master here and return it. - return merge.strip('/master') + return merge.replace('/master', '') else: # We couldn't find anything to deal with, bitch about it. raise FedpkgError('Unable to match a known branch name. Use --dist') @@ -1121,7 +1121,7 @@ class PackageModule: # We couldn't hit koji, bail. raise FedpkgError('Unable to query koji to find rawhide target') desttag = rawhidetarget['dest_tag_name'] - return desttag.strip('dist-f') + return desttag.replace('dist-f', '') def _getlocalarch(self): """Get the local arch as defined by rpm""" -- cgit