EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
987 stars 155 forks source link

Enabled DeprecationWarning by default and fixed references #2255

Closed ElSaico closed 3 weeks ago

ElSaico commented 3 weeks ago

Description

Our use of DeprecationWarning falls into two traps described in the warnings library documentation:

  1. Since Python 3.7 this particular warning is not shown by default, unless triggered directly in __main__ (or the -W argument is set on the interpreter)
  2. Calls to warnings.warn() display their own lines, which defeats the purpose of DeprecationWarning - the stacklevel exists for that, pointing one level down to the plugin function calling them.

Type of Change

A convenience for plugin developers which would otherwise miss that they are using deprecated functions.

How Tested

Running the latest version of some plugins showed immediate results - the use of myNotebook.Label being particularly common.

Notes