summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-14 12:56:56 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-02-23 19:06:46 +0100
commitdfec9b6de562240ecff503b3164d63fac878656c (patch)
treeab3ee13663473863571ce36ca487a1e9589d13b7
parent18b9c41f683ffee20795fda17bb11a456e6d0470 (diff)
fix python 3.8 deprecation warnings
the logo changes were caused by > Support of nested sets and set operations as in Unicode Technical Standard > #18 might be added in the future. This would change the syntax, so to facilitate > this change a FutureWarning will be raised in ambiguous cases for the time being. > That includes sets starting with a literal '[' or containing literal character > sequences '--', '&&', '~~', and '||'. > To avoid a warning escape them with a backslash. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94191 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit b5fcdc3c07efb2c1175503b9c70e6d7336aa1452) (cherry picked from commit db4d5b571ca21267d8a534aa959472551ab7e091) Change-Id: I4d48be3df2eaadf03a9d1f5750c0c94b3abbf674
-rw-r--r--scripting/source/pyprov/pythonscript.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index acb6184bf437..ea5877e2fc07 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -21,7 +21,7 @@ import uno
import unohelper
import sys
import os
-import imp
+import types
import time
import ast
import platform
@@ -346,7 +346,7 @@ class ScriptContext(unohelper.Base):
# code = readTextFromStream( sfa.openFileRead( url ) )
# execute the module
-# entry = ModuleEntry( lastRead, imp.new_module("ooo_script_framework") )
+# entry = ModuleEntry( lastRead, types.ModuleType("ooo_script_framework") )
# entry.module.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = g_scriptContext
# entry.module.__file__ = url
# exec code in entry.module.__dict__
@@ -488,7 +488,7 @@ class ProviderContext:
src = ensureSourceState( src )
# execute the module
- entry = ModuleEntry( lastRead, imp.new_module("ooo_script_framework") )
+ entry = ModuleEntry( lastRead, types.ModuleType("ooo_script_framework") )
entry.module.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = self.scriptContext
code = None
@@ -582,7 +582,7 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation,
if event.ActionCommand == "Run":
code = self.editor.getControl("EditorTextField").getText()
code = ensureSourceState( code )
- mod = imp.new_module("ooo_script_framework")
+ mod = types.ModuleType("ooo_script_framework")
mod.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = self.provCtx.scriptContext
exec(code, mod.__dict__)
values = mod.__dict__.get( CALLABLE_CONTAINER_NAME , None )