From f1e7522054cc3ba2ec091e1356357410502644b8 Mon Sep 17 00:00:00 2001 From: Boskovic Date: Fri, 25 Oct 2019 12:34:56 +0200 Subject: [PATCH] Adding DLL path on windows for Python >= 3.8 --- src/pyrfc/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pyrfc/__init__.py b/src/pyrfc/__init__.py index 1ce2508..5ee2083 100755 --- a/src/pyrfc/__init__.py +++ b/src/pyrfc/__init__.py @@ -14,6 +14,16 @@ # import from internal modules that they could be directly imported from # the pyrfc package + + +# Set DLL path, due to https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew +import os +if os.name == 'nt': + try: + os.add_dll_directory(os.path.join(os.environ["SAPNWRFC_HOME"], "lib")) + except Exception: + pass + from pyrfc._exception import ( RFCError, RFCLibError,