[Python] How do I turn off a warning that isn't labeled as "Deprecation Warning", but actually...

Discussão em 'Python' iniciado por Stack, Setembro 2, 2025.

  1. Stack

    Stack Membro Participativo

    (Python 3.12.4 Visual Studio Code) How do I disable this warning? It's bulky and annoying (the program works, but it obscures my prints):

    File "C:\Users\czarn\AppData\Roaming\Anki2\addons21\2055492159\__init__.py", line 563, in createDeck
    `self.startEditing()`
    File "C:\Users\czarn\AppData\Roaming\Anki2\addons21\2055492159\__init__.py", line 217, in startEditing
    `self.window().requireReset()`
    File "aqt.main", line 912, in requireReset
    requireReset() is obsolete; please use CollectionOp()


    How can I disable it?

    I've tried to ignore it but the typical solutions for disabling deprecation warnings don't work (I don't think this is even seen as deprecation warning):

    def warn(*args, **kwargs):
    pass
    import warnings
    warnings.warn = warn


    Nor does this:

    import warnings
    warnings.filterwarnings("ignore", category=DeprecationWarning)


    Also tried changing from debugging mode to error mode:

    import warnings
    import logging
    logging.basicConfig(level=logging.ERROR)
    warnings.filterwarnings("ignore")


    Is there any other way I can ignore this? Maybe there's a way or a terminal setting that I can use to disable it?

    Continue reading...

Compartilhe esta Página