summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
Diffstat (limited to 'gbp')
-rw-r--r--gbp/config.py4
-rw-r--r--gbp/git/repository.py4
-rw-r--r--gbp/rpm/__init__.py10
-rw-r--r--gbp/rpm/policy.py2
-rw-r--r--gbp/scripts/common/pq.py4
-rwxr-xr-xgbp/scripts/import_srpm.py2
6 files changed, 13 insertions, 13 deletions
diff --git a/gbp/config.py b/gbp/config.py
index 8b659240..ab24f222 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -17,7 +17,7 @@
"""handles command line and config file option parsing for the gbp commands"""
from optparse import OptionParser, OptionGroup, Option, OptionValueError
-from configparser import SafeConfigParser, NoSectionError
+from configparser import ConfigParser, NoSectionError
from copy import copy
import os.path
import tempfile
@@ -393,7 +393,7 @@ class GbpOptionParser(OptionParser):
Parse the possible config files and set appropriate values
default values
"""
- parser = SafeConfigParser()
+ parser = ConfigParser()
# Fill in the built in values
self.config = dict(self.__class__.defaults)
# Update with the values from the defaults section. This is needed
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 4d82d28a..9d94b822 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1197,10 +1197,10 @@ class GitRepository(object):
fetch_url = None
push_urls = []
for line in out.decode().splitlines():
- match = re.match('\s*Fetch\s+URL:\s*(\S.*)', line)
+ match = re.match(r'\s*Fetch\s+URL:\s*(\S.*)', line)
if match:
fetch_url = match.group(1)
- match = re.match('\s*Push\s+URL:\s*(\S.*)', line)
+ match = re.match(r'\s*Push\s+URL:\s*(\S.*)', line)
if match:
push_urls.append(match.group(1))
remotes[remote] = GitRemote(remote, fetch_url, push_urls)
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py
index a4e6b791..63956804 100644
--- a/gbp/rpm/__init__.py
+++ b/gbp/rpm/__init__.py
@@ -111,11 +111,11 @@ class SrcRpmFile(object):
class SpecFile(object):
"""Class for parsing/modifying spec files"""
tag_re = re.compile(r'^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*:\s*'
- '(?P<value>\S(.*\S)?)\s*$', flags=re.I)
+ r'(?P<value>\S(.*\S)?)\s*$', flags=re.I)
directive_re = re.compile(r'^%(?P<name>[a-z]+)(?P<num>[0-9]+)?'
- '(\s+(?P<args>.*))?$', flags=re.I)
+ r'(\s+(?P<args>.*))?$', flags=re.I)
gbptag_re = re.compile(r'^\s*#\s*gbp-(?P<name>[a-z-]+)'
- '(\s*:\s*(?P<args>\S.*))?$', flags=re.I)
+ r'(\s*:\s*(?P<args>\S.*))?$', flags=re.I)
# Here "sections" stand for all scripts, scriptlets and other directives,
# but not macros
section_identifiers = ('package', 'description', 'prep', 'build', 'install',
@@ -622,7 +622,7 @@ class SpecFile(object):
if not tag['num'] in ignored:
tag_prev = self._delete_tag('patch', tag['num'])
# Remove a preceding comment if it seems to originate from GBP
- if re.match("^\s*#.*patch.*auto-generated",
+ if re.match(r"^\s*#.*patch.*auto-generated",
str(tag_prev), flags=re.I):
tag_prev = self._content.delete(tag_prev)
@@ -639,7 +639,7 @@ class SpecFile(object):
# Remove a preceding comment line if it ends with '.patch' or
# '.diff' plus an optional compression suffix
- if re.match("^\s*#.+(patch|diff)(\.(gz|bz2|xz|lzma))?\s*$",
+ if re.match(r"^\s*#.+(patch|diff)(\.(gz|bz2|xz|lzma))?\s*$",
str(macro_prev), flags=re.I):
macro_prev = self._content.delete(macro_prev)
diff --git a/gbp/rpm/policy.py b/gbp/rpm/policy.py
index 82e877da..9af28095 100644
--- a/gbp/rpm/policy.py
+++ b/gbp/rpm/policy.py
@@ -29,7 +29,7 @@ class RpmPkgPolicy(PkgPolicy):
alnum = 'a-zA-Z0-9'
# Valid characters for RPM pkg name
- name_whitelist_chars = '._+%{}\-'
+ name_whitelist_chars = r'._+%{}\-'
# Valid characters for RPM pkg version
version_whitelist_chars = '._+%{}~'
diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py
index bd49e94d..fd53eb79 100644
--- a/gbp/scripts/common/pq.py
+++ b/gbp/scripts/common/pq.py
@@ -50,7 +50,7 @@ def pq_branch_match(branch, pq_fmt_str):
>>> pq_branch_match('foo/bar/1.0/pq', 'foo/%(br)s/%(ver)s/pq').groupdict()
{'ver': '1.0', 'br': 'bar'}
"""
- pq_re = '^%s$' % re.sub('%\(([a-z_\-]+)\)s', r'(?P<\1>\\S+)', pq_fmt_str)
+ pq_re = '^%s$' % re.sub(r'%\(([a-z_\-]+)\)s', r'(?P<\1>\\S+)', pq_fmt_str)
return re.match(pq_re, branch)
@@ -207,7 +207,7 @@ def write_patch_file(filename, commit_info, diff):
name = commit_info['author']['name']
email = commit_info['author']['email']
# Git compat: put name in quotes if special characters found
- if re.search("[,.@()\[\]\\\:;]", name):
+ if re.search(r"[,.@()\[\]\\\:;]", name):
name = '"%s"' % name
from_header = Header(header_name='from')
try:
diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py
index 88ca4819..2806e59e 100755
--- a/gbp/scripts/import_srpm.py
+++ b/gbp/scripts/import_srpm.py
@@ -382,7 +382,7 @@ def main(argv):
# for both upstream sources and packaging files
author = None
if spec.packager:
- match = re.match('(?P<name>.*[^ ])\s*<(?P<email>\S*)>',
+ match = re.match(r'(?P<name>.*[^ ])\s*<(?P<email>\S*)>',
spec.packager.strip())
if match:
author = GitModifier(match.group('name'), match.group('email'))