D10.1.6 error with max 2021 (python 2 -> python 3)

Much More Sexy:
So if user use Python 2 in 2021, this still should work :slight_smile:

fn getMaxscriptListFromPythonList pythonList =
		(
			maxscriptList = #()
			if SMTDFunctions.getMaxVersionAsInteger() >= 2017 then -- Python wrappers added in 2017
			(
				--check Python Version
				local py_imp = python.import "sys"
				local Py_Vers = ((py_imp.version) [1]) as integer	--First give me version
				--Depending of Py version
				Case Py_Vers of
				(
					2: (bi = python.Import("__builtin__"))
					3: (bi = python.Import("builtins"))
				)
				
				for i = 1 to bi.len(pythonList) do
				(
					append maxscriptList pythonList[i]
				)
			)
			else
			(
				throw "function getMaxscriptListFromPythonList is only available in 3dsmax 2017 or later."
			)
			return maxscriptList
		),