Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply option to ignore InsecureRequestWarning permanently #7424

Merged
merged 3 commits into from
Aug 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

from six import PY2

try:
import datadog_agent # noqa: F401

dev_mode = False
except ImportError:
dev_mode = True


def _simplefilter_py2(action, category=Warning, lineno=0, append=0):
"""
Expand All @@ -32,7 +39,8 @@ def disable_warnings_ctx(action, disable=True):
if disable:
simplefilter('ignore', action)
yield
simplefilter('default', action)
if not dev_mode:
simplefilter('default', action)
else:
# do nothing
yield