Raytracing: remove some more deprecated Py2 code

This commit is contained in:
wmayer
2021-04-26 11:04:26 +02:00
parent 72a3b9cb51
commit 83dcfae0f6
2 changed files with 1 additions and 12 deletions

View File

@@ -203,10 +203,6 @@ private:
vecs[i][l] = PyFloat_AsDouble(temp);
else if (PyLong_Check(temp))
vecs[i][l] = (double) PyLong_AsLong(temp);
#if PY_MAJOR_VERSION < 3
else if (PyInt_Check(temp))
vecs[i][l] = (double) PyInt_AsLong(temp);
#endif
else
throw Py::ValueError("Wrong parameter format, four Tuple of three floats needed!");
}

View File

@@ -261,11 +261,8 @@ void CmdRaytracingWriteView::activated(int)
openCommand("Write view");
doCommand(Doc,"import Raytracing,RaytracingGui");
#if PY_MAJOR_VERSION < 3
doCommand(Doc,"OutFile = open(unicode(\"%s\",\"utf-8\"),\"w\")",cFullName.c_str());
#else
doCommand(Doc,"OutFile = open(\"%s\",\"w\")",cFullName.c_str());
#endif
try {
doCommand(Doc,"result = open(App.getResourceDir()+'Mod/Raytracing/Templates/ProjectStd.pov').read()");
doCommand(Doc,"content = ''");
@@ -558,11 +555,7 @@ void CmdRaytracingExportProject::activated(int)
doCommand(Doc,"PageFile = open(App.activeDocument().%s.PageResult,'r')",Sel[0].FeatName);
std::string fname = (const char*)fn.toUtf8();
fname = strToPython(fname);
#if PY_MAJOR_VERSION < 3
doCommand(Doc,"OutFile = open(unicode('%s','utf-8'),'w')",fname.c_str());
#else
doCommand(Doc,"OutFile = open('%s','w')",fname.c_str());
#endif
doCommand(Doc,"OutFile.write(PageFile.read())");
doCommand(Doc,"del OutFile,PageFile");