Browse Source

build ymake with py3-ymake

snermolaev 1 year ago
parent
commit
12dab647f0
3 changed files with 6 additions and 4 deletions
  1. 2 1
      build/plugins/_common.py
  2. 3 2
      build/plugins/pybuild.py
  3. 1 1
      build/plugins/ytest.py

+ 2 - 1
build/plugins/_common.py

@@ -1,3 +1,4 @@
+import six
 import sys
 import hashlib
 import base64
@@ -22,7 +23,7 @@ def lazy(func):
 
 
 def pathid(path):
-    return base64.b32encode(hashlib.md5(path).digest()).lower().strip('=')
+    return six.ensure_str(base64.b32encode(hashlib.md5(six.ensure_binary(path)).digest()).lower().strip(b'='))
 
 
 def listid(l):

+ 3 - 2
build/plugins/pybuild.py

@@ -1,5 +1,6 @@
-import os
 import collections
+import os
+import six
 from hashlib import md5
 
 import ymake
@@ -528,7 +529,7 @@ def onpy_srcs(unit, *args):
         if py3:
             mod_list_md5 = md5()
             for path, mod in pys:
-                mod_list_md5.update(mod)
+                mod_list_md5.update(six.ensure_binary(mod))
                 if not (venv and is_extended_source_search_enabled(path, unit)):
                     dest = 'py/' + mod.replace('.', '/') + '.py'
                     if with_py:

+ 1 - 1
build/plugins/ytest.py

@@ -359,7 +359,7 @@ def deserialize_list(val):
 
 
 def get_correct_expression_for_group_var(varname):
-    return "\"${join=\;:" + varname + "}\""
+    return r"\"${join=\;:" + varname + "}\""
 
 
 def count_entries(x):