1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 13:18:42 +02:00

Inject no-op print() into http.client when http debugging is off

This solves a crash that occasionaly occurs - osc tries to use a function that is not there
This commit is contained in:
2022-09-07 13:49:46 +02:00
parent 39c00d55c6
commit 157d4b79f8

View File

@@ -53,6 +53,7 @@ class MockRequest:
def enable_http_debug(config):
if not int(config["http_debug"]) and not int(config["http_full_debug"]):
http.client.print = lambda *args, **kwargs: None
return
# HACK: override HTTPResponse's init to increase debug level