From 8d34d4d4f5e965ffaea571ef0a08fc2df15935aa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 8 Oct 2017 12:58:28 +0200 Subject: [PATCH] Turn on overflow checking in sip --- qutebrowser/misc/earlyinit.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index ca12cd901..5e8d4a1dd 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -230,8 +230,8 @@ def check_libraries(): _check_modules(modules) -def remove_inputhook(): - """Remove the PyQt input hook. +def configure_pyqt(): + """Remove the PyQt input hook and enable overflow checking. Doing this means we can't use the interactive shell anymore (which we don't anyways), but we can use pdb instead. @@ -239,6 +239,13 @@ def remove_inputhook(): from PyQt5.QtCore import pyqtRemoveInputHook pyqtRemoveInputHook() + import sip + try: + # Added in sip 4.19.4 + sip.enableoverflowchecking(True) + except AttributeError: + pass + def init_log(args): """Initialize logging. @@ -279,6 +286,6 @@ def early_init(args): # errors, so people only using the GUI notice them as well. check_libraries() check_qt_version() - remove_inputhook() + configure_pyqt() check_ssl_support() check_optimize_flag()