提交 0e6f5dda authored 作者: George Ho's avatar George Ho

Blackify code

上级 83df68c5
......@@ -1656,7 +1656,9 @@ class CLinker(link.Linker):
{struct_name} *self = ({struct_name} *)PyCapsule_GetContext(capsule);
delete self;
}}
""".format(struct_name=self.struct_name)
""".format(
struct_name=self.struct_name
)
# We add all the support code, compile args, headers and libs we need.
for support_code in self.support_code() + self.c_support_code_apply:
......@@ -1753,7 +1755,8 @@ class CLinker(link.Linker):
print(" delete struct_ptr;", file=code)
print(" return NULL;", file=code)
print(" }", file=code)
print("""\
print(
"""\
PyObject* thunk = PyCapsule_New((void*)(&{struct_name}_executor), NULL, {struct_name}_destructor);
if (thunk != NULL && PyCapsule_SetContext(thunk, struct_ptr) != 0) {{
PyErr_Clear();
......
......@@ -599,6 +599,7 @@ def remove(predicate, coll):
import hashlib
def hash_from_code(msg):
# hashlib.sha256() requires an object that supports buffer interface,
# but Python 3 (unicode) strings don't.
......
......@@ -53,7 +53,6 @@ def decode_with(x, encoding):
return x.decode(encoding)
class DefaultOrderedDict(OrderedDict):
def __init__(self, default_factory=None, *a, **kw):
if default_factory is not None and not isinstance(default_factory, Callable):
......@@ -111,4 +110,3 @@ def maybe_add_to_os_environ_pathlist(var, newpath):
os.environ[var] = newpaths
except Exception:
pass
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论