equal
deleted
inserted
replaced
189 """ |
189 """ |
190 if not ispathsafe(fname): |
190 if not ispathsafe(fname): |
191 return |
191 return |
192 |
192 |
193 fpath = os.path.join(*fname.split(b'/')) |
193 fpath = os.path.join(*fname.split(b'/')) |
194 if isinstance(directory, bytes): |
194 path = os.path.join(directory, fpath) |
195 directory = [directory] |
|
196 for d in directory: |
|
197 path = os.path.join(d, fpath) |
|
198 if os.path.exists(path): |
|
199 break |
|
200 try: |
195 try: |
201 os.stat(path) |
196 os.stat(path) |
202 ct = pycompat.sysbytes( |
197 ct = pycompat.sysbytes( |
203 mimetypes.guess_type(pycompat.fsdecode(path))[0] or r"text/plain" |
198 mimetypes.guess_type(pycompat.fsdecode(path))[0] or r"text/plain" |
204 ) |
199 ) |