@@ -9,7 +9,7 @@ def newmodule(name):
9
9
"A new module with the given name."
10
10
global _newmodule
11
11
if _newmodule is None :
12
- _newmodule = Main .seval ("name -> (n1=Symbol(name); n2=gensym(n1); Main.@eval(module $n2; module $n1; end; end); Main.@eval $n2.$n1)" )
12
+ _newmodule = Main .seval ("name -> (n1=Symbol(name); n2=gensym(n1); Main.@eval(module $n2; module $n1; end; end); Main.@eval $n2.$n1)" ) # noqa: F821
13
13
return _newmodule (name )
14
14
15
15
_convert = None
@@ -18,15 +18,15 @@ def convert(T, x):
18
18
"Convert x to a Julia T."
19
19
global _convert
20
20
if _convert is None :
21
- _convert = PythonCall .JlWrap .seval ("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))" )
21
+ _convert = PythonCall .JlWrap .seval ("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))" ) # noqa: F821
22
22
return _convert (T , x )
23
23
24
24
def interactive (enable = True ):
25
25
"Allow the Julia event loop to run in the background of the Python REPL."
26
26
if enable :
27
- PythonCall .Compat ._set_python_input_hook ()
27
+ PythonCall .Compat ._set_python_input_hook () # noqa: F821
28
28
else :
29
- PythonCall .Compat ._unset_python_input_hook ()
29
+ PythonCall .Compat ._unset_python_input_hook () # noqa: F821
30
30
31
31
class JuliaError (Exception ):
32
32
"An error arising in Julia code."
@@ -36,9 +36,9 @@ def __str__(self):
36
36
e = self .exception
37
37
b = self .backtrace
38
38
if b is None :
39
- return Base .sprint (Base .showerror , e )
39
+ return Base .sprint (Base .showerror , e ) # noqa: F821
40
40
else :
41
- return Base .sprint (Base .showerror , e , b )
41
+ return Base .sprint (Base .showerror , e , b ) # noqa: F821
42
42
@property
43
43
def exception (self ):
44
44
return self .args [0 ]
@@ -241,7 +241,7 @@ def jlstr(x):
241
241
CONFIG ['inited' ] = True
242
242
243
243
if CONFIG ['opt_handle_signals' ] is None :
244
- if Base .Threads .nthreads () > 1 :
244
+ if Base .Threads .nthreads () > 1 : # noqa: F821
245
245
# a warning to help multithreaded users
246
246
# TODO: should we set PYTHON_JULIACALL_HANDLE_SIGNALS=yes whenever PYTHON_JULIACALL_THREADS != 1?
247
247
warnings .warn (
0 commit comments