Skip to content

Commit 0cc7650

Browse files
author
Drew O'Meara
committed
push/popBusy now private
1 parent 99bcb40 commit 0cc7650

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

modules/runtime.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func NewContext(opts py.ContextOpts) py.Context {
6060
}
6161

6262
func (ctx *context) ModuleInit(impl *py.ModuleImpl) (*py.Module, error) {
63-
err := ctx.PushBusy()
64-
defer ctx.PopBusy()
63+
err := ctx.pushBusy()
64+
defer ctx.popBusy()
6565
if err != nil {
6666
return nil, err
6767
}
@@ -101,8 +101,8 @@ func (ctx *context) ModuleInit(impl *py.ModuleImpl) (*py.Module, error) {
101101
}
102102

103103
func (ctx *context) ResolveAndCompile(pathname string, opts py.CompileOpts) (py.CompileOut, error) {
104-
err := ctx.PushBusy()
105-
defer ctx.PopBusy()
104+
err := ctx.pushBusy()
105+
defer ctx.popBusy()
106106
if err != nil {
107107
return py.CompileOut{}, err
108108
}
@@ -181,20 +181,20 @@ func (ctx *context) ResolveAndCompile(pathname string, opts py.CompileOpts) (py.
181181
return out, nil
182182
}
183183

184-
func (ctx *context) PushBusy() error {
184+
func (ctx *context) pushBusy() error {
185185
if ctx.closed {
186186
return py.ExceptionNewf(py.RuntimeError, "Context closed")
187187
}
188188
ctx.running.Add(1)
189189
return nil
190190
}
191191

192-
func (ctx *context) PopBusy() {
192+
func (ctx *context) popBusy() {
193193
ctx.running.Done()
194194
}
195195

196196
// Close -- see type py.Context
197-
func (ctx *context) Close() {
197+
func (ctx *context) Close() error {
198198
ctx.closeOnce.Do(func() {
199199
ctx.closing = true
200200
ctx.running.Wait()
@@ -204,6 +204,7 @@ func (ctx *context) Close() {
204204
ctx.store.OnContextClosed()
205205
close(ctx.done)
206206
})
207+
return nil
207208
}
208209

209210
// Done -- see type py.Context
@@ -265,8 +266,8 @@ func resolveRunPath(runPath string, opts py.CompileOpts, pathObjs []py.Object, t
265266
}
266267

267268
func (ctx *context) RunCode(code *py.Code, globals, locals py.StringDict, closure py.Tuple) (py.Object, error) {
268-
err := ctx.PushBusy()
269-
defer ctx.PopBusy()
269+
err := ctx.pushBusy()
270+
defer ctx.popBusy()
270271
if err != nil {
271272
return nil, err
272273
}

0 commit comments

Comments
 (0)