Fix bad regex escaping

This commit is contained in:
Nyall Dawson 2018-05-21 14:22:36 +10:00
parent a7397b1726
commit 3de7b383b0
2 changed files with 2 additions and 2 deletions

View File

@ -214,7 +214,7 @@ class Repositories(QObject):
def urlParams(self):
""" return GET parameters to be added to every request """
# Strip down the point release segment from the version string
return "?qgis=%s" % re.sub('\.\d*$', '', pyQgisVersion())
return "?qgis={}".format(re.sub(r'\.\d*$', '', pyQgisVersion()))
# ----------------------------------------- #
def setRepositoryData(self, reposName, key, value):

View File

@ -207,7 +207,7 @@ def pyQgisVersion():
If Y = 99, bump up to (X+1.0.0), so e.g. 2.99 becomes 3.0.0
This way QGIS X.99 is only compatible with plugins for the upcoming major release.
"""
x, y, z = re.findall('^(\d*).(\d*).(\d*)', Qgis.QGIS_VERSION)[0]
x, y, z = re.findall(r'^(\d*).(\d*).(\d*)', Qgis.QGIS_VERSION)[0]
if y == '99':
x = str(int(x) + 1)
y = z = '0'