Revert "Fix NUL byte error handling on Python 3.4"
This reverts commit a7d5a98cc4
.
Not needed anymore now that we dropped support.
This commit is contained in:
parent
e8ceeceac8
commit
b8389e4496
@ -251,7 +251,7 @@ def read_config_py(filename=None, raising=False):
|
||||
|
||||
try:
|
||||
code = compile(source, filename, 'exec')
|
||||
except (ValueError, TypeError) as e:
|
||||
except ValueError as e:
|
||||
# source contains NUL bytes
|
||||
desc = configexc.ConfigErrorDesc("Error while compiling", e)
|
||||
raise configexc.ConfigFileErrors(basename, [desc])
|
||||
|
@ -409,7 +409,7 @@ class TestConfigPy:
|
||||
|
||||
assert len(excinfo.value.errors) == 1
|
||||
error = excinfo.value.errors[0]
|
||||
assert isinstance(error.exception, (TypeError, ValueError))
|
||||
assert isinstance(error.exception, ValueError)
|
||||
assert error.text == "Error while compiling"
|
||||
exception_text = 'source code string cannot contain null bytes'
|
||||
assert str(error.exception) == exception_text
|
||||
|
Loading…
Reference in New Issue
Block a user