mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 03:34:48 +08:00
Support non ascii characters in the source code (#4047)
This commit is contained in:
@@ -123,7 +123,9 @@ class FunctionDescriptor(object):
|
||||
try:
|
||||
# If we are running a script or are in IPython, include the source
|
||||
# code in the hash.
|
||||
source = inspect.getsource(function).encode("ascii")
|
||||
source = inspect.getsource(function)
|
||||
if sys.version_info[0] >= 3:
|
||||
source = source.encode()
|
||||
function_source_hasher.update(source)
|
||||
function_source_hash = function_source_hasher.digest()
|
||||
except (IOError, OSError, TypeError):
|
||||
|
||||
Reference in New Issue
Block a user