Skip to content

Commit f6441a0

Browse files
committed
fix: update Python version check to support Python 4+ across all platform detectors
1 parent 2bc51a2 commit f6441a0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

UnityMcpBridge/Editor/Dependencies/PlatformDetectors/LinuxPlatformDetector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
226226
version = output.Substring(7); // Remove "Python " prefix
227227
fullPath = pythonPath;
228228

229-
// Validate minimum version (3.10+)
229+
// Validate minimum version (Python 4+ or Python 3.10+)
230230
if (TryParseVersion(version, out var major, out var minor))
231231
{
232-
return major >= 3 && minor >= 10;
232+
return major > 3 || (major >= 3 && minor >= 10);
233233
}
234234
}
235235
}

UnityMcpBridge/Editor/Dependencies/PlatformDetectors/MacOSPlatformDetector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
226226
version = output.Substring(7); // Remove "Python " prefix
227227
fullPath = pythonPath;
228228

229-
// Validate minimum version (3.10+)
229+
// Validate minimum version (Python 4+ or Python 3.10+)
230230
if (TryParseVersion(version, out var major, out var minor))
231231
{
232-
return major >= 3 && minor >= 10;
232+
return major > 3 || (major >= 3 && minor >= 10);
233233
}
234234
}
235235
}

UnityMcpBridge/Editor/Dependencies/PlatformDetectors/WindowsPlatformDetector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
214214
version = output.Substring(7); // Remove "Python " prefix
215215
fullPath = pythonPath;
216216

217-
// Validate minimum version (3.10+)
217+
// Validate minimum version (Python 4+ or Python 3.10+)
218218
if (TryParseVersion(version, out var major, out var minor))
219219
{
220-
return major >= 3 && minor >= 10;
220+
return major > 3 || (major >= 3 && minor >= 10);
221221
}
222222
}
223223
}

0 commit comments

Comments
 (0)