Add comment explaining to_native usage.

pull/50999/head
Matt Clay 6 years ago
parent 53a640f2cc
commit 54867b4add

@ -351,6 +351,7 @@ class PluginLoader:
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.simplefilter("ignore", RuntimeWarning) warnings.simplefilter("ignore", RuntimeWarning)
with open(to_bytes(path), 'rb') as module_file: with open(to_bytes(path), 'rb') as module_file:
# to_native is used here because imp.load_source's path is for tracebacks and python's traceback formatting uses native strings
module = imp.load_source(full_name, to_native(path), module_file) module = imp.load_source(full_name, to_native(path), module_file)
return module return module

Loading…
Cancel
Save