From b8389e4496028fce178031fc79eee478f4d8e4c9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 22 Sep 2017 22:30:02 +0200 Subject: [PATCH] Revert "Fix NUL byte error handling on Python 3.4" This reverts commit a7d5a98cc4843437244e7633f622dd71be9f500e. Not needed anymore now that we dropped support. --- qutebrowser/config/configfiles.py | 2 +- tests/unit/config/test_configfiles.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index 622280ee7..c9720a6d8 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -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]) diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py index ed5d2b882..6a58659fa 100644 --- a/tests/unit/config/test_configfiles.py +++ b/tests/unit/config/test_configfiles.py @@ -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