MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / maybe_encode_env

Function maybe_encode_env

configure.py:1319–1329  ·  view source on GitHub ↗

Encodes unicode in env to str on Windows python 2.x.

(env)

Source from the content-addressed store, hash-verified

1317 """Run find_cuda_config.py and return cuda_toolkit_path, or None."""
1318
1319 def maybe_encode_env(env):
1320 """Encodes unicode in env to str on Windows python 2.x."""
1321 if not is_windows() or sys.version_info[0] != 2:
1322 return env
1323 for k, v in env.items():
1324 if isinstance(k, unicode):
1325 k = k.encode('ascii')
1326 if isinstance(v, unicode):
1327 v = v.encode('ascii')
1328 env[k] = v
1329 return env
1330
1331 cuda_libraries = ['cuda', 'cudnn']
1332 if is_linux():

Callers 1

validate_cuda_configFunction · 0.85

Calls 2

is_windowsFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected