Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Lib/glob.py

    r2 r388  
    66import fnmatch
    77
     8try:
     9    _unicode = unicode
     10except NameError:
     11    # If Python is built without Unicode support, the unicode type
     12    # will not exist. Fake one.
     13    class _unicode(object):
     14        pass
     15
    816__all__ = ["glob", "iglob"]
    917
     
    1119    """Return a list of paths matching a pathname pattern.
    1220
    13     The pattern may contain simple shell-style wildcards a la fnmatch.
     21    The pattern may contain simple shell-style wildcards a la
     22    fnmatch. However, unlike fnmatch, filenames starting with a
     23    dot are special cases that are not matched by '*' and '?'
     24    patterns.
    1425
    1526    """
     
    1930    """Return an iterator which yields the paths matching a pathname pattern.
    2031
    21     The pattern may contain simple shell-style wildcards a la fnmatch.
     32    The pattern may contain simple shell-style wildcards a la
     33    fnmatch. However, unlike fnmatch, filenames starting with a
     34    dot are special cases that are not matched by '*' and '?'
     35    patterns.
    2236
    2337    """
     
    3145            yield name
    3246        return
    33     if has_magic(dirname):
     47    # `os.path.split()` returns the argument itself as a dirname if it is a
     48    # drive or UNC path.  Prevent an infinite recursion if a drive or UNC path
     49    # contains magic characters (i.e. r'\\?\C:').
     50    if dirname != pathname and has_magic(dirname):
    3451        dirs = iglob(dirname)
    3552    else:
     
    5067    if not dirname:
    5168        dirname = os.curdir
    52     if isinstance(pattern, unicode) and not isinstance(dirname, unicode):
     69    if isinstance(pattern, _unicode) and not isinstance(dirname, unicode):
    5370        dirname = unicode(dirname, sys.getfilesystemencoding() or
    5471                                   sys.getdefaultencoding())
Note: See TracChangeset for help on using the changeset viewer.