diff --git a/mitmproxy/utils/debug.py b/mitmproxy/utils/debug.py index ff98b86cf..c2eee2b6c 100644 --- a/mitmproxy/utils/debug.py +++ b/mitmproxy/utils/debug.py @@ -37,8 +37,12 @@ def dump_system_info(): except: pass + bin_indicator = "" # PyInstaller builds indicator, if using precompiled binary + if getattr(sys, 'frozen', False): + bin_indicator = "Precompiled Binary" + data = [ - "Mitmproxy version: {} ({})".format(version.VERSION, git_describe), + "Mitmproxy version: {} ({}) {}".format(version.VERSION, git_describe, bin_indicator), "Python version: {}".format(platform.python_version()), "Platform: {}".format(platform.platform()), "SSL version: {}".format(SSL.SSLeay_version(SSL.SSLEAY_VERSION).decode()), diff --git a/test/mitmproxy/utils/test_debug.py b/test/mitmproxy/utils/test_debug.py index 22f8dc669..b6d6407cf 100644 --- a/test/mitmproxy/utils/test_debug.py +++ b/test/mitmproxy/utils/test_debug.py @@ -1,11 +1,13 @@ import io import subprocess +import sys from unittest import mock from mitmproxy.utils import debug def test_dump_system_info(): + setattr(sys, 'frozen', True) assert debug.dump_system_info() with mock.patch('subprocess.check_output') as m: