Commit 2fd26408 authored by PJ Eby's avatar PJ Eby

Fix error if script contains null byte. (backport from trunk)

--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053814
parent 8acf86a7
...@@ -1460,7 +1460,7 @@ def is_python(text, filename='<string>'): ...@@ -1460,7 +1460,7 @@ def is_python(text, filename='<string>'):
"Is this string a valid Python script?" "Is this string a valid Python script?"
try: try:
compile(text, filename, 'exec') compile(text, filename, 'exec')
except SyntaxError: except (SyntaxError, TypeError):
return False return False
else: else:
return True return True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment