Show More
@@ -56,16 +56,11 b' def ignorepats(lines):' | |||
|
56 | 56 | return patterns, warnings |
|
57 | 57 | |
|
58 | 58 | def readignorefile(filepath, warn): |
|
59 | try: | |
|
60 | pats = [] | |
|
61 | fp = open(filepath) | |
|
62 | pats, warnings = ignorepats(fp) | |
|
63 | fp.close() | |
|
64 | for warning in warnings: | |
|
65 | warn("%s: %s\n" % (filepath, warning)) | |
|
66 | except IOError, inst: | |
|
67 | warn(_("skipping unreadable ignore file '%s': %s\n") % | |
|
68 | (filepath, inst.strerror)) | |
|
59 | fp = open(filepath) | |
|
60 | pats, warnings = ignorepats(fp) | |
|
61 | fp.close() | |
|
62 | for warning in warnings: | |
|
63 | warn("%s: %s\n" % (filepath, warning)) | |
|
69 | 64 | return pats |
|
70 | 65 | |
|
71 | 66 | def readpats(root, files, warn): |
@@ -75,7 +70,11 b' def readpats(root, files, warn):' | |||
|
75 | 70 | for f in files: |
|
76 | 71 | if f in pats: |
|
77 | 72 | continue |
|
78 | pats[f] = readignorefile(f, warn) | |
|
73 | try: | |
|
74 | pats[f] = readignorefile(f, warn) | |
|
75 | except IOError, inst: | |
|
76 | warn(_("skipping unreadable ignore file '%s': %s\n") % | |
|
77 | (f, inst.strerror)) | |
|
79 | 78 | |
|
80 | 79 | return [(f, pats[f]) for f in files if f in pats] |
|
81 | 80 |
General Comments 0
You need to be logged in to leave comments.
Login now