pythonconsole: replace deprecated method