come_from_opt handles and/or precidence properly

main.py: give a better error message when file is not found.
This commit is contained in:
rocky
2016-05-08 15:51:54 -04:00
parent debb46b0fe
commit b11f6d94f7
4 changed files with 31 additions and 2 deletions

Binary file not shown.

View File

@@ -0,0 +1,17 @@
# 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)