Skip to content

Commit bc5d297

Browse files
committed
Fix for python>=3.8
1 parent 4a5a11c commit bc5d297

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ install:
117117

118118
build_script:
119119
- set "PATH=C:\symengine\bin\;%PATH%"
120+
- set "SYMENGINE_PY_ADD_PATH_TO_SEARCH_DIRS=1"
120121
- echo %PATH%
121122
- if [%COMPILER%]==[MSVC15] python setup.py install build_ext --compiler=msvc --build-type=%BUILD_TYPE%
122123
- if [%COMPILER%]==[MinGW] python setup.py install build_ext --compiler=mingw --inplace

symengine/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
import os
2+
import sys
3+
4+
if sys.version_info >= (3, 8, 0) and sys.platform == 'win32' \
5+
and 'SYMENGINE_PY_ADD_PATH_TO_SEARCH_DIRS' in os.environ:
6+
for directory in os.environ['PATH'].split(';'):
7+
if os.path.isdir(directory):
8+
os.add_dll_directory(directory)
9+
10+
del os, sys
11+
112
import symengine.lib.symengine_wrapper as wrapper
213

314
from .lib.symengine_wrapper import (

0 commit comments

Comments
 (0)