From a60198dcc268f2639c02771b682c26ff547f6e85 Mon Sep 17 00:00:00 2001 From: EvgeneOskin Date: Mon, 7 Dec 2020 10:23:06 +1300 Subject: [PATCH] Ignore cryptography deprecation warnings in DEBUG It also fixes #158 --- termius/main.py | 9 +++++++++ tox.ini | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/termius/main.py b/termius/main.py index b452df4..1567904 100644 --- a/termius/main.py +++ b/termius/main.py @@ -2,9 +2,18 @@ # -*- coding: utf-8 -*- """Entrypoint for CLI tool.""" import sys +import os +import warnings from termius.app import TermiusApp +if os.getenv('TERMIUS_CLI_DEBUG'): + warnings.filterwarnings( + 'ignore', r'Python 2 is no longer supported by the Python core team. ', + UserWarning, r'termius' + ) + + def main(argv=None): """Process call from terminal.""" app = TermiusApp() diff --git a/tox.ini b/tox.ini index 96d3e79..6b3b071 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py27,py35 +envlist = py27,py36 skipsdist = True [testenv] @@ -15,6 +15,8 @@ commands = paver completion_tests paver bats passenv = SERVERAUDITOR_USERNAME SERVERAUDITOR_PASSWORD +setenv = + TERMIUS_CLI_DEBUG = 1 [flake8] exclude = .git*