mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
Merge pull request #2041 from krsoninikhil/debug
Adds PyInstaller build indicator to --version argument
This commit is contained in:
commit
51e08a5b85
@ -37,8 +37,12 @@ def dump_system_info():
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
bin_indicator = "" # PyInstaller builds indicator, if using precompiled binary
|
||||||
|
if getattr(sys, 'frozen', False):
|
||||||
|
bin_indicator = "Precompiled Binary"
|
||||||
|
|
||||||
data = [
|
data = [
|
||||||
"Mitmproxy version: {} ({})".format(version.VERSION, git_describe),
|
"Mitmproxy version: {} ({}) {}".format(version.VERSION, git_describe, bin_indicator),
|
||||||
"Python version: {}".format(platform.python_version()),
|
"Python version: {}".format(platform.python_version()),
|
||||||
"Platform: {}".format(platform.platform()),
|
"Platform: {}".format(platform.platform()),
|
||||||
"SSL version: {}".format(SSL.SSLeay_version(SSL.SSLEAY_VERSION).decode()),
|
"SSL version: {}".format(SSL.SSLeay_version(SSL.SSLEAY_VERSION).decode()),
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import io
|
import io
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from mitmproxy.utils import debug
|
from mitmproxy.utils import debug
|
||||||
|
|
||||||
|
|
||||||
def test_dump_system_info():
|
def test_dump_system_info():
|
||||||
|
setattr(sys, 'frozen', True)
|
||||||
assert debug.dump_system_info()
|
assert debug.dump_system_info()
|
||||||
|
|
||||||
with mock.patch('subprocess.check_output') as m:
|
with mock.patch('subprocess.check_output') as m:
|
||||||
|
Loading…
Reference in New Issue
Block a user