~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/pipes.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
_funnychars = '"`$\\'                           # Unsafe inside "double quotes"
268
268
 
269
269
def quote(file):
 
270
    ''' return a shell-escaped version of the file string '''
270
271
    for c in file:
271
272
        if c not in _safechars:
272
273
            break
273
274
    else:
 
275
        if not file:
 
276
            return "''"
274
277
        return file
275
278
    if '\'' not in file:
276
279
        return '\'' + file + '\''