[PATCH 4/6] Use string object methods instead of the string module

John Wright jsw at debian.org
Wed Jul 29 13:35:30 UTC 2009


From: John Wright <john at johnwright.org>

This patch replaces all instances of

    string.join(sequence, s)

with

    s.join(sequence)

and removes the import of the string module.
---
 debian_bundle/deb822.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/debian_bundle/deb822.py b/debian_bundle/deb822.py
index f4f3942..cf4fc48 100644
--- a/debian_bundle/deb822.py
+++ b/debian_bundle/deb822.py
@@ -32,7 +32,6 @@ except ImportError:
 
 import os
 import re
-import string
 import sys
 import StringIO
 import UserDict
@@ -694,11 +693,11 @@ class PkgRelation(object):
             if dep.has_key('version') and dep['version'] is not None:
                 s += ' (%s %s)' % dep['version']
             if dep.has_key('arch') and dep['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.6.3.3




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