[python-debian/master 10/36] Use sep.join(list) rather than string.join(list, sep).

Colin Watson cjwatson at canonical.com
Mon Oct 8 07:41:21 UTC 2012


---
 examples/debfile/changelog_head |    3 +--
 examples/debfile/dpkg-info      |    3 +--
 lib/debian/deb822.py            |    7 +++----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/examples/debfile/changelog_head b/examples/debfile/changelog_head
index 83a8bec..f145cd9 100755
--- a/examples/debfile/changelog_head
+++ b/examples/debfile/changelog_head
@@ -13,7 +13,6 @@ shipped in a .deb file."""
 
 from __future__ import print_function
 
-import string
 import sys
 
 from debian import debfile
@@ -33,5 +32,5 @@ if __name__ == '__main__':
     deb = debfile.DebFile(sys.argv[1])
     chg = deb.changelog()
     entries = chg._blocks[:entries]
-    print(string.join(map(str, entries)))
+    print(''.join(map(str, entries)))
 
diff --git a/examples/debfile/dpkg-info b/examples/debfile/dpkg-info
index a565bf4..d98999a 100755
--- a/examples/debfile/dpkg-info
+++ b/examples/debfile/dpkg-info
@@ -16,7 +16,6 @@ from __future__ import print_function
 
 import os
 import stat
-import string
 import sys
 
 from debian import debfile
@@ -49,7 +48,7 @@ if __name__ == '__main__':
         if n.lower() == 'description':  # increase indentation of long dsc
             lines = v.split('\n')
             short_dsc = lines[0]
-            long_dsc = string.join(map(lambda l: ' ' + l, lines[1:]), '\n')
+            long_dsc = '\n'.join(map(lambda l: ' ' + l, lines[1:]))
             print(' %s: %s\n%s' % (n, short_dsc, long_dsc))
         else:
             print(' %s: %s' % (n, v))
diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py
index e8690e2..e2a277f 100644
--- a/lib/debian/deb822.py
+++ b/lib/debian/deb822.py
@@ -37,7 +37,6 @@ except (ImportError, AttributeError):
 import chardet
 import os
 import re
-import string
 import subprocess
 import sys
 import warnings
@@ -855,11 +854,11 @@ class PkgRelation(object):
             if dep.get('version') is not None:
                 s += ' (%s %s)' % dep['version']
             if dep.get('arch') is not None:
-                s += ' [%s]' % string.join(map(pp_arch, dep['arch']))
+                s += ' [%s]' % ' '.join(map(pp_arch, dep['arch']))
             return s
 
-        pp_or_dep = lambda deps: string.join(map(pp_atomic_dep, deps), ' | ')
-        return string.join(map(pp_or_dep, rels), ', ')
+        pp_or_dep = lambda deps: ' | '.join(map(pp_atomic_dep, deps))
+        return ', '.join(map(pp_or_dep, rels))
 
 
 class _lowercase_dict(dict):
-- 
1.7.2.5





More information about the pkg-python-debian-commits mailing list