diff options
author | Jesse Keating <jkeating@redhat.com> | 2011-02-22 13:36:35 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2011-02-22 13:36:35 -0700 |
commit | 6d4334e325f67586d97cb861ed18484286150eaf (patch) | |
tree | 982bac8f8b797925b6915a0f62e5b3f6b41a47c0 /src/pyfedpkg | |
parent | b7996b83ebe280a3558c035fc9c56d5cfba2cdf9 (diff) | |
download | fedora-packager-6d4334e325f67586d97cb861ed18484286150eaf.tar.gz fedora-packager-6d4334e325f67586d97cb861ed18484286150eaf.tar.xz fedora-packager-6d4334e325f67586d97cb861ed18484286150eaf.zip |
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.
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r-- | src/pyfedpkg/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
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""" |