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/os.py

    r2 r388  
    264264    """
    265265
    266     from os.path import join, isdir, islink
     266    islink, join, isdir = path.islink, path.join, path.isdir
    267267
    268268    # We may not have read permission for top, in which case we can't
     
    290290        yield top, dirs, nondirs
    291291    for name in dirs:
    292         path = join(top, name)
    293         if followlinks or not islink(path):
    294             for x in walk(path, topdown, onerror, followlinks):
     292        new_path = join(top, name)
     293        if followlinks or not islink(new_path):
     294            for x in walk(new_path, topdown, onerror, followlinks):
    295295                yield x
    296296    if not topdown:
     
    515515
    516516def _exists(name):
    517     try:
    518         eval(name)
    519         return True
    520     except NameError:
    521         return False
     517    return name in globals()
    522518
    523519# Supply spawn*() (probably only for Unix)
     
    743739except NameError: # statvfs_result may not exist
    744740    pass
    745 
    746 if not _exists("urandom"):
    747     def urandom(n):
    748         """urandom(n) -> str
    749 
    750         Return a string of n random bytes suitable for cryptographic use.
    751 
    752         """
    753         try:
    754             _urandomfd = open("/dev/urandom", O_RDONLY)
    755         except (OSError, IOError):
    756             raise NotImplementedError("/dev/urandom (or equivalent) not found")
    757         try:
    758             bs = b""
    759             while n - len(bs) >= 1:
    760                 bs += read(_urandomfd, n - len(bs))
    761         finally:
    762             close(_urandomfd)
    763         return bs
Note: See TracChangeset for help on using the changeset viewer.