From 1e589f05dffb09f0aa0af9b77f6822d10dbf4e1d Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 26 Apr 2021 11:12:34 +0200 Subject: [PATCH] Drawing: remove some more deprecated Py2 code --- src/Mod/Drawing/Gui/Command.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/Mod/Drawing/Gui/Command.cpp b/src/Mod/Drawing/Gui/Command.cpp index 5114064418..59589ca5e8 100644 --- a/src/Mod/Drawing/Gui/Command.cpp +++ b/src/Mod/Drawing/Gui/Command.cpp @@ -76,11 +76,7 @@ void CmdDrawingOpen::activated(int iMsg) filename = Base::Tools::escapeEncodeFilename(filename); // load the file with the module Command::doCommand(Command::Gui, "import Drawing, DrawingGui"); -#if PY_MAJOR_VERSION < 3 - Command::doCommand(Command::Gui, "DrawingGui.open(unicode(\"%s\",\"utf-8\"))", (const char*)filename.toUtf8()); -#else Command::doCommand(Command::Gui, "DrawingGui.open(\"%s\")", (const char*)filename.toUtf8()); -#endif } } @@ -601,11 +597,7 @@ void CmdDrawingSymbol::activated(int iMsg) filename = Base::Tools::escapeEncodeFilename(filename); openCommand("Create Symbol"); doCommand(Doc,"import Drawing"); -#if PY_MAJOR_VERSION < 3 - doCommand(Doc,"f = open(unicode(\"%s\",'utf-8'),'r')",(const char*)filename.toUtf8()); -#else doCommand(Doc,"f = open(\"%s\",'r')",(const char*)filename.toUtf8()); -#endif doCommand(Doc,"svg = f.read()"); doCommand(Doc,"f.close()"); doCommand(Doc,"App.activeDocument().addObject('Drawing::FeatureViewSymbol','%s')",FeatName.c_str()); @@ -662,11 +654,7 @@ void CmdDrawingExportPage::activated(int iMsg) doCommand(Doc,"PageFile = open(App.activeDocument().%s.PageResult,'r')",Sel[0].FeatName); std::string fname = (const char*)fn.toUtf8(); fname = Base::Tools::escapeEncodeFilename(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");