Files
python-uncompyle6/test/simple_source/comprehension/10-list-ifnot.py
rocky b11f6d94f7 come_from_opt handles and/or precidence properly
main.py: give a better error message when file is not found.
2016-05-08 15:51:54 -04:00

18 lines
461 B
Python

# Test semantic handling of
# [x for x in names if not y]
import os
def bug(dirname, pattern):
if not dirname:
if isinstance(pattern, bytes):
dirname = bytes(os.curdir, 'ASCII')
else:
dirname = os.curdir
try:
names = os.listdir(dirname)
except os.error:
return []
if not _ishidden(pattern):
names = [x for x in names if not _ishidden(x)]
return fnmatch.filter(names, pattern)