MCPcopy Index your code
hub / github.com/python/cpython / is_ubuntu

Function is_ubuntu

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

Source from the content-addressed store, hash-verified

162# Ubuntu has patched OpenSSL and changed behavior of security level 2
163# see https://bugs.python.org/issue41561#msg389003
164def is_ubuntu():
165 try:
166 # Assume that any references of "ubuntu" implies Ubuntu-like distro
167 # The workaround is not required for 18.04, but doesn't hurt either.
168 with open("/etc/os-release", encoding="utf-8") as f:
169 return "ubuntu" in f.read()
170 except FileNotFoundError:
171 return False
172
173if is_ubuntu():
174 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…