From 9a97a26511584f41c3753fa9536e1c4a8dce637a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 16 Aug 2019 10:38:18 +0100 Subject: member 'Context' of struct type 'uno.Exception' not given a value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie80f729e5c1dbf3214f9532dcb935b239bac7997 Reviewed-on: https://gerrit.libreoffice.org/77566 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- scripting/source/pyprov/pythonscript.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'scripting/source/pyprov') diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py index 67251e6ada61..bd2aa3e1670e 100644 --- a/scripting/source/pyprov/pythonscript.py +++ b/scripting/source/pyprov/pythonscript.py @@ -176,6 +176,7 @@ def toIniName( str ): class MyUriHelper: def __init__( self, ctx, location ): + self.ctx = ctx self.s_UriMap = \ { "share" : "vnd.sun.star.expand:$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/Scripts/python" , \ "share:uno_packages" : "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages", \ @@ -203,7 +204,7 @@ class MyUriHelper: if not storageURI.startswith( self.m_baseUri ): message = "pythonscript: storage uri '" + storageURI + "' not in base uri '" + self.m_baseUri + "'" log.debug( message ) - raise RuntimeException( message ) + raise RuntimeException( message, self.ctx ) ret = "vnd.sun.star.script:" + \ storageURI[len(self.m_baseUri)+1:].replace("/","|") + \ @@ -235,12 +236,12 @@ class MyUriHelper: if not xFileUri: message = "pythonscript: invalid relative uri '" + sFileUri+ "'" log.debug( message ) - raise RuntimeException( message ) + raise RuntimeException( message, self.ctx ) if xFileUri.isAbsolute(): message = "pythonscript: an absolute uri is invalid '" + sFileUri+ "'" log.debug( message ) - raise RuntimeException( message ) + raise RuntimeException( message, self.ctx ) # absolute path to the .py file xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, True, RETAIN) @@ -250,7 +251,7 @@ class MyUriHelper: if not sAbsScriptUri.startswith(sBaseUri): message = "pythonscript: storage uri '" + sAbsScriptUri + "' not in base uri '" + self.m_baseUri + "'" log.debug( message ) - raise RuntimeException( message ) + raise RuntimeException( message, self.ctx ) ret = sAbsScriptUri if funcNameStart != -1: @@ -259,10 +260,10 @@ class MyUriHelper: return ret except UnoException as e: log.error( "error during converting scriptURI="+scriptURI + ": " + e.Message) - raise RuntimeException( "pythonscript:scriptURI2StorageUri: " + e.Message, None ) + raise RuntimeException( "pythonscript:scriptURI2StorageUri: " + e.Message, self.ctx ) except Exception as e: log.error( "error during converting scriptURI="+scriptURI + ": " + str(e)) - raise RuntimeException( "pythonscript:scriptURI2StorageUri: " + str(e), None ) + raise RuntimeException( "pythonscript:scriptURI2StorageUri: " + str(e), self.ctx ) class ModuleEntry: -- cgit