Commit 382414fe authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Christos Stavrakakis
Browse files

Replace rstrip with re.sub

With rstrip we specify a set of characters to be removed.
We want to remove a substring hence the use of re.sub.
(rstrip produces wrong results in many cases)
parent 53c0a891
......@@ -34,6 +34,7 @@
import os
import git
import sh
import re
from collections import namedtuple
from configobj import ConfigObj
......@@ -123,7 +124,7 @@ def get_debian_branch(branch):
if _get_branch(deb_branch):
return deb_branch
# Check without distribution
deb_branch = deb_branch.rstrip("-" + distribution)
deb_branch = re.sub("-" + distribution + "$", "", deb_branch)
if _get_branch(deb_branch):
return deb_branch
branch_type = BRANCH_TYPES[get_branch_type(branch)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment