OSDN Git Service

Fake brutal_hackery on Py3.
authorSimon Forman <sforman@hushmail.com>
Fri, 24 Apr 2020 07:00:41 +0000 (00:00 -0700)
committerSimon Forman <sforman@hushmail.com>
Fri, 24 Apr 2020 07:00:41 +0000 (00:00 -0700)
Because I'm not about to try to figure it out tonight.

joy/library.py

index 2de9f42..0775149 100644 (file)
@@ -41,7 +41,11 @@ import operator, math
 
 from .parser import text_to_expression, Symbol
 from .utils.stack import expression_to_string, list_to_stack, iter_stack, pick, concat
-from .utils.brutal_hackery import rename_code_object
+import sys
+if sys.version_info.major < 3:
+  from .utils.brutal_hackery import rename_code_object
+else:
+  rename_code_object = lambda _: lambda f: f
 
 from .utils import generated_library as genlib
 from .utils.types import (