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

Function _create_registry_data

Lib/test/test_launcher.py:100–110  ·  view source on GitHub ↗
(root, key, value)

Source from the content-addressed store, hash-verified

98
99def create_registry_data(root, data):
100 def _create_registry_data(root, key, value):
101 if isinstance(value, dict):
102 # For a dict, we recursively create keys
103 with winreg.CreateKeyEx(root, key) as hkey:
104 for k, v in value.items():
105 _create_registry_data(hkey, k, v)
106 elif isinstance(value, str):
107 # For strings, we set values. 'key' may be None in this case
108 winreg.SetValueEx(root, key, None, winreg.REG_SZ, value)
109 else:
110 raise TypeError("don't know how to create data for '{}'".format(value))
111
112 for k, v in data.items():
113 _create_registry_data(root, k, v)

Callers 1

create_registry_dataFunction · 0.85

Calls 2

itemsMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…