Skip to content

Commit 871fc3c

Browse files
committed
Allow arbitrary version of Python standard library
Fixes #804
1 parent c6bf67d commit 871fc3c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Bonsai.Scripting/Bonsai.Scripting.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<PackageTags>Bonsai Rx Scripting</PackageTags>
77
<UseWindowsForms>true</UseWindowsForms>
88
<TargetFramework>net462</TargetFramework>
9-
<Version>2.6.0</Version>
9+
<Version>2.6.1</Version>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<PackageReference Include="IronPython" Version="2.7.5" />

Bonsai.Scripting/PythonEngine.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ internal static ScriptEngine Create()
1111
{
1212
var engine = Python.CreateEngine();
1313
var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
14-
var lib = Path.Combine(basePath, "../../../IronPython.StdLib.2.7.5/content/Lib");
15-
var sitePackages = Path.Combine(lib, "site-packages");
16-
engine.SetSearchPaths(new[] { lib, sitePackages });
14+
var libPath = Directory.GetDirectories(Path.Combine(basePath, "../../../"), "IronPython.StdLib.*");
15+
if (libPath.Length == 1)
16+
{
17+
var lib = Path.Combine(libPath[0], $"content/Lib");
18+
var sitePackages = Path.Combine(lib, "site-packages");
19+
engine.SetSearchPaths(new[] { lib, sitePackages });
20+
}
1721
return engine;
1822
}
1923
}

0 commit comments

Comments
 (0)