From e3c9502b4692c2a3eeb7b5b08c0903a19e80163b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 16 Dec 2020 15:36:32 +1000 Subject: [PATCH] ignore pickle.dumps() warning --- qt/aqt/profiles.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qt/aqt/profiles.py b/qt/aqt/profiles.py index 81927b21f..6fdd82dfa 100644 --- a/qt/aqt/profiles.py +++ b/qt/aqt/profiles.py @@ -7,6 +7,7 @@ import pickle import random import shutil import traceback +import warnings from typing import Any, Dict, List, Optional from send2trash import send2trash @@ -241,7 +242,12 @@ class ProfileManager: return up.load() def _pickle(self, obj) -> bytes: - return pickle.dumps(obj, protocol=4) + # pyqt needs to be updated to fix + # 'PY_SSIZE_T_CLEAN will be required for '#' formats' warning + # check if this is still required for pyqt6 + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + return pickle.dumps(obj, protocol=4) def load(self, name) -> bool: assert name != "_global"