@@ -135,6 +135,7 @@ class ReplForJupyterImpl(
135
135
override val resolverConfig : ResolverConfig ? = null ,
136
136
override val runtimeProperties : ReplRuntimeProperties = defaultRuntimeProperties,
137
137
private val scriptReceivers : List <Any > = emptyList(),
138
+ private val embedded : Boolean = false ,
138
139
) : ReplForJupyter, ReplOptions, KotlinKernelHost {
139
140
140
141
constructor (config: KernelConfig , runtimeProperties: ReplRuntimeProperties , scriptReceivers: List <Any > = emptyList()):
@@ -316,12 +317,14 @@ class ReplForJupyterImpl(
316
317
317
318
private val evaluatorConfiguration = ScriptEvaluationConfiguration {
318
319
implicitReceivers.invoke(v = scriptReceivers)
319
- jvm {
320
- val filteringClassLoader = FilteringClassLoader (ClassLoader .getSystemClassLoader()) {
321
- it.startsWith(" jupyter.kotlin." ) || it.startsWith(" kotlin." ) || (it.startsWith(" org.jetbrains.kotlin." ) && ! it.startsWith(" org.jetbrains.kotlin.jupyter." ))
320
+ if (! embedded) {
321
+ jvm {
322
+ val filteringClassLoader = FilteringClassLoader (ClassLoader .getSystemClassLoader()) {
323
+ it.startsWith(" jupyter.kotlin." ) || it.startsWith(" kotlin." ) || (it.startsWith(" org.jetbrains.kotlin." ) && ! it.startsWith(" org.jetbrains.kotlin.jupyter." ))
324
+ }
325
+ val scriptClassloader = URLClassLoader (scriptClasspath.map { it.toURI().toURL() }.toTypedArray(), filteringClassLoader)
326
+ baseClassLoader(scriptClassloader)
322
327
}
323
- val scriptClassloader = URLClassLoader (scriptClasspath.map { it.toURI().toURL() }.toTypedArray(), filteringClassLoader)
324
- baseClassLoader(scriptClassloader)
325
328
}
326
329
constructorArgs(this @ReplForJupyterImpl as KotlinKernelHost )
327
330
}
0 commit comments