[elbe-devel] [PATCH 02/10] replace string.join it is deprecated in python2

Manuel Traut manut at linutronix.de
Fri Sep 29 00:11:38 CEST 2017


and no longer available in python3

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/commands/parselicence.py | 6 +++---
 elbepack/xmldefaults.py           | 2 +-
 elbepack/xsdtoasciidoc.mako       | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/elbepack/commands/parselicence.py b/elbepack/commands/parselicence.py
index b2ff5038..708d5aa4 100644
--- a/elbepack/commands/parselicence.py
+++ b/elbepack/commands/parselicence.py
@@ -83,9 +83,9 @@ class license_dep5_to_spdx (dict):
                     ands.append (mapped_lic + u" WITH " + with_split[1])
                 else:
                     ands.append (mapped_lic)
-            ors.append (string.join (ands, u' AND '))
+            ors.append (str(' AND ').join (ands))
 
-        retval = string.join (ors, u' OR ')
+        retval = str(' OR ').join (ors)
         return retval
 
 
@@ -136,7 +136,7 @@ def license_string (pkg):
         else:
             l_list.append (ll.et.text)
 
-    return string.join (l_list, ' AND ')
+    return str(' AND ').join (l_list)
 
 
 
diff --git a/elbepack/xmldefaults.py b/elbepack/xmldefaults.py
index f45206cb..147d4be6 100644
--- a/elbepack/xmldefaults.py
+++ b/elbepack/xmldefaults.py
@@ -178,7 +178,7 @@ def get_random_mac():
     binaddr[0] |= 0x02
     s = map( lambda x: "%02x" % x, binaddr )
 
-    return string.join( s, ":" )
+    return str(":").join (s)
 
 
 class ElbeDefaults(object):
diff --git a/elbepack/xsdtoasciidoc.mako b/elbepack/xsdtoasciidoc.mako
index 093debdf..68def262 100644
--- a/elbepack/xsdtoasciidoc.mako
+++ b/elbepack/xsdtoasciidoc.mako
@@ -14,7 +14,7 @@ def docindent( s, indent=0 ):
   lines = s.splitlines()
   lines = map(string.strip, lines)
   lines = map(lambda x: indent*" "+x, lines)
-  return string.join(lines).strip()
+  return str('').join(lines).strip()
 
 def genlink(typ):
   if typ.startswith("rfs:"):
-- 
2.14.1




More information about the elbe-devel mailing list