Description: Fix syntax warnings
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/1085903
Forwarded: no
Last-Update: 2024-11-27

--- python-dcos-0.2.0.orig/dcos/jsonitem.py
+++ python-dcos-0.2.0/dcos/jsonitem.py
@@ -269,7 +269,7 @@ def _parse_url(value):
     scheme_pattern = r'^(?P<scheme>(?:(?:https?)://))'
     domain_pattern = (
         r'(?P<hostname>(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.?)+'
-        '(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)?|')  # domain,
+        r'(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)?|')  # domain,
 
     value_regex = re.match(
         scheme_pattern +  # http:// or https://
--- python-dcos-0.2.0.orig/dcos/package.py
+++ python-dcos-0.2.0/dcos/package.py
@@ -941,7 +941,7 @@ class HttpSource(Source):
                                       os.path.join(tmp_dir, item))]
 
                 # There should only be one directory present after extracting.
-                assert(len(enclosing_dirs) is 1)
+                assert(len(enclosing_dirs) == 1)
 
                 enclosing_dir = os.path.join(tmp_dir, enclosing_dirs[0])
 
@@ -1100,7 +1100,7 @@ class Registry():
             validate_script = os.path.join(scripts_dir,
                                            '1-validate-packages.sh')
             result = subprocess.call(validate_script)
-        if result is not 0:
+        if result != 0:
             return ["Source tree is not valid [{}]".format(self._base_path)]
         else:
             return []
@@ -1194,7 +1194,7 @@ class Registry():
         :rtype: Package
         """
 
-        if len(package_name) is 0:
+        if len(package_name) != 0:
             raise DCOSException('Package name must not be empty.')
 
         # Packages are found in $BASE/repo/package/<first_character>/<pkg_name>
--- python-dcos-0.2.0.orig/dcos/util.py
+++ python-dcos-0.2.0/dcos/util.py
@@ -352,8 +352,8 @@ def _hack_error_message_fix(message):
     # This regular expression matches the character 'u' followed by the
     # single-quote character, all optionally preceded by a left square
     # bracket, parenthesis, curly brace, or whitespace character.
-    return re.compile("([\[\(\{\s])u'").sub(
-        "\g<1>'",
+    return re.compile(r"([\[\(\{\s])u'").sub(
+        r"\g<1>'",
         re.compile("^u'").sub("'", message))
 
 
