From 2ab48627ddcce7642cd320525e87776421b95387 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 23 Nov 2016 16:29:12 +0300 Subject: [PATCH] Workaround for Debian 6.0 (issues #1868 and #1878) Loading of SketchPlugin should be before loading of SketchAPI module --- src/PythonAPI/model/sketcher/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/PythonAPI/model/sketcher/__init__.py b/src/PythonAPI/model/sketcher/__init__.py index 7aa993434..2edb1d226 100644 --- a/src/PythonAPI/model/sketcher/__init__.py +++ b/src/PythonAPI/model/sketcher/__init__.py @@ -1,5 +1,20 @@ """Package for Sketch plugin for the Parametric Geometry API of the Modeler. """ +# DEBIAN 6.0 WORKAROUND START +""" + Following code is used to support Debian 6.0. + It is kept, because SketchPlugin should be loaded before SketchAPI is first used. + Otherwise, the runtime error will be generated while some static inline methods are broken. +""" +from ModelAPI import * +aSession = ModelAPI_Session.get() +aDocument = aSession.moduleDocument() +aSession.startOperation() +aDocument.addFeature("Sketch") +aSession.finishOperation() +aSession.abortOperation() +# DEBIAN 6.0 WORKAROUND FINISH + from SketchAPI import addSketch from tools import addPolyline, addPolygon -- 2.39.2