diff --git a/extensions/composer/extension.py b/extensions/composer/extension.py index d3495253a..17c60db8d 100644 --- a/extensions/composer/extension.py +++ b/extensions/composer/extension.py @@ -94,7 +94,7 @@ def read_exts_from_path(self, path): def pick_php_version(self, requested): selected = None - if requested is None or requested is '': + if requested is None or requested == '': return self._ctx['PHP_VERSION'] # requested is coming from the composer.json file and is a unicode string type. diff --git a/extensions/dynatrace/extension.py b/extensions/dynatrace/extension.py index 9f06df34c..2ae465470 100644 --- a/extensions/dynatrace/extension.py +++ b/extensions/dynatrace/extension.py @@ -260,7 +260,7 @@ def update_agent_config(self): # store static config in same kind of data structure (nested dictionary) # as we use for the config from we fetched from the API - section_regex = re.compile('\[(.*)\]') + section_regex = re.compile(r'\[(.*)\]') config_section = "" config_from_agent = dict() _log.debug("Starting to parse OneAgent config...") diff --git a/extensions/sessions/extension.py b/extensions/sessions/extension.py index 1e6820ab3..c489f98f1 100644 --- a/extensions/sessions/extension.py +++ b/extensions/sessions/extension.py @@ -111,13 +111,13 @@ def _compile(self, install): # modify php.ini to contain the right session config self.load_config() self._php_ini.update_lines( - '^session\.name = JSESSIONID$', + r'^session\.name = JSESSIONID$', 'session.name = PHPSESSIONID') self._php_ini.update_lines( - '^session\.save_handler = files$', + r'^session\.save_handler = files$', 'session.save_handler = %s' % self.service.EXTENSION_NAME) self._php_ini.update_lines( - '^session\.save_path = "@{TMPDIR}"$', + r'^session\.save_path = "@{TMPDIR}"$', 'session.save_path = "%s"' % self.service.session_save_path()) self.service.custom_config_php_ini(self._php_ini) self._php_ini.save(self._php_ini_path) diff --git a/tests/test_composer.py b/tests/test_composer.py index 63ce58eb4..1d050b60d 100644 --- a/tests/test_composer.py +++ b/tests/test_composer.py @@ -74,7 +74,7 @@ def test_composer_tool_install(self): installer.package.return_value.done.assert_called_once() # make sure composer is installed installer._installer._install_binary_from_manifest.assert_called_once() - assert re.match('/composer/[\d\.]+/composer.phar', installer._installer._install_binary_from_manifest.call_args[0][0]), \ + assert re.match(r'/composer/[\d\.]+/composer.phar', installer._installer._install_binary_from_manifest.call_args[0][0]), \ "was %s" % installer._installer._install_binary_from_manifest.call_args[0][0] def test_composer_tool_install_latest(self):