Merging upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
9011a461b8
commit
2a78ba5ef7
4 changed files with 23 additions and 3 deletions
|
@ -183,6 +183,7 @@ EXTENSIONS = {
|
|||
'txsprofile': {'text', 'ini', 'txsprofile'},
|
||||
'txt': {'text', 'plain-text'},
|
||||
'v': {'text', 'verilog'},
|
||||
'vb': {'text', 'vb'},
|
||||
'vbproj': {'text', 'xml', 'vbproj'},
|
||||
'vcxproj': {'text', 'xml', 'vcxproj'},
|
||||
'vdx': {'text', 'vdx'},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import errno
|
||||
import os.path
|
||||
import re
|
||||
import shlex
|
||||
|
@ -205,8 +206,14 @@ def parse_shebang_from_file(path: str) -> Tuple[str, ...]:
|
|||
if not os.access(path, os.X_OK):
|
||||
return ()
|
||||
|
||||
with open(path, 'rb') as f:
|
||||
return parse_shebang(f)
|
||||
try:
|
||||
with open(path, 'rb') as f:
|
||||
return parse_shebang(f)
|
||||
except OSError as e:
|
||||
if e.errno == errno.EINVAL:
|
||||
return ()
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
COPYRIGHT_RE = re.compile(r'^\s*(Copyright|\(C\)) .*$', re.I | re.MULTILINE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue