def _rlistdir(dirname): if not dirname: if isinstance(dirname, binary_type): dirname = binary_type(os.curdir, 'ASCII') else: dirname = os.curdir try: names = os.listdir(dirname) except os.error: return for x in names: yield x path = os.path.join(dirname, x) if dirname else x for y in _rlistdir(path): yield os.path.join(x, y)
def _rlistdir(dirname): if not dirname: if isinstance(dirname, binary_type): dirname = binary_type(os.curdir, 'ASCII') else: dirname = os.curdir try: names = os.listdir(dirname) except os.error: return for x in names: yield x path = os.path.join(dirname, x) if dirname else x for y in _rlistdir(path): yield os.path.join(x, y)