MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_ubuntu

Function is_ubuntu

Lib/test/test_ssl.py:144–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142# Ubuntu has patched OpenSSL and changed behavior of security level 2
143# see https://bugs.python.org/issue41561#msg389003
144def is_ubuntu():
145 try:
146 # Assume that any references of "ubuntu" implies Ubuntu-like distro
147 # The workaround is not required for 18.04, but doesn't hurt either.
148 with open("/etc/os-release", encoding="utf-8") as f:
149 return "ubuntu" in f.read()
150 except FileNotFoundError:
151 return False
152
153if is_ubuntu():
154 def seclevel_workaround(*ctxs):

Callers 1

test_ssl.pyFile · 0.85

Calls 2

openFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected