Skip to content

Commit c44bccc

Browse files
committed
avoid PythonCall use before import
1 parent addbb9f commit c44bccc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/ReactionMechanismSimulator.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ packages = keys(CondaPkg.current_packages())
55

66
if !("rmg" in packages) && !("rmgmolecule" in packages)
77
@info "missing rmg and rmgmolecule installing rmgmolecule..."
8-
if !(v"3.7" <= PythonCall.C.python_version() && PythonCall.C.python_version() <= v"3.9")
8+
if "python" in packages
9+
py_version = VersionNumber(packages["python"][:version])
10+
else
11+
py_version = nothing
12+
end
13+
if py_version === nothing || !(v"3.7" <= py_version) && py_version <= v"3.9")
914
@info "python version was not in 3.7-3.9 changing python version"
1015
CondaPkg.add("python"; version="3.9")
1116
end

src/rmstest.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ packages = keys(CondaPkg.current_packages())
66

77
if !("rmg" in packages) && !("rmgmolecule" in packages)
88
@info "missing rmg and rmgmolecule installing rmgmolecule..."
9-
if !(v"3.7" <= PythonCall.C.python_version() && PythonCall.C.python_version() <= v"3.9")
9+
if "python" in packages
10+
py_version = VersionNumber(packages["python"][:version])
11+
else
12+
py_version = nothing
13+
end
14+
if py_version === nothing || !(v"3.7" <= py_version) && py_version <= v"3.9")
1015
@info "python version was not in 3.7-3.9 changing python version"
1116
CondaPkg.add("python"; version="3.9")
1217
end

0 commit comments

Comments
 (0)