Commit cc7069e0 authored by Kirill Smelkov's avatar Kirill Smelkov

context: Move code to pyx

In preparation to start migrating, at least partially, context
functionality to nogil mode, first, similarly to package time (see
32f34607 "time: Move code to pyx"), move the code from context.py to
_context.pyx.

This is straight code movement + associated  setup.py & co adjusts.

We don't move just to context.pyx (note no _ prefix), since we will need
to continue distinguishing pyx/nogil from py objects/functions.
parent 77719d8a
/_context.cpp
/_golang.cpp /_golang.cpp
/_golang_test.cpp /_golang_test.cpp
/_sync.cpp /_sync.cpp
......
This diff is collapsed.
This diff is collapsed.
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
from __future__ import print_function, absolute_import from __future__ import print_function, absolute_import
from golang import context, time, nilchan from golang import context, _context, time, nilchan
from golang.context import _ready as ready from golang._context import _ready as ready
from golang.time_test import dt from golang.time_test import dt
# assertCtx asserts on state of _BaseCtx* # assertCtx asserts on state of _BaseCtx*
def assertCtx(ctx, children, deadline=None, err=None, done=False): def assertCtx(ctx, children, deadline=None, err=None, done=False):
assert isinstance(ctx, context._BaseCtx) assert isinstance(ctx, _context._BaseCtx)
assert ctx.deadline() == deadline assert ctx.deadline() == deadline
assert ctx.err() is err assert ctx.err() is err
assert ready(ctx.done()) == done assert ready(ctx.done()) == done
......
...@@ -214,6 +214,9 @@ setup( ...@@ -214,6 +214,9 @@ setup(
'golang/runtime/libgolang_test_c.c', 'golang/runtime/libgolang_test_c.c',
'golang/runtime/libgolang_test.cpp']), 'golang/runtime/libgolang_test.cpp']),
Ext('golang._context',
['golang/_context.pyx']),
Ext('golang._sync', Ext('golang._sync',
['golang/_sync.pyx']), ['golang/_sync.pyx']),
Ext('golang._sync_test', Ext('golang._sync_test',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment