diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-12 17:52:35 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-12 20:45:09 +0200 |
commit | 4cdd446b090e3b04cd36d9bd992ca020381c039e (patch) | |
tree | b272b8ee1a494675a16b61889acbc1a52807e7dc /wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py | |
parent | 3c0193c43bd6ff88032c7b39c4393b9384fa88bf (diff) |
imp is deprecated since Python v.3.4
This avoid Python warnings about this during checks
Change-Id: I6647d9c93f3c2fbc1af475f8bc45e03300ee8b79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100518
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py')
-rw-r--r-- | wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py index b1d53de6b4f6..15631123fbcb 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py @@ -24,8 +24,16 @@ class AgendaWizardDialogResources(object): SECTION_MINUTES = "MINUTES" def __init__(self): - import imp, os - imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')) + import sys, os + + # imp is deprecated since Python v.3.4 + if sys.version_info >= (3,3): + from importlib.machinery import SourceFileLoader + SourceFileLoader('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')).load_module() + else: + import imp + imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')) + import strings self.resAgendaWizardDialog_title = strings.RID_AGENDAWIZARDDIALOG_START_1 |