Skip to content

Commit

Permalink
Don’t add DLL directories when using Windows executable
Browse files Browse the repository at this point in the history
Related to #2289.
  • Loading branch information
liZe committed Dec 7, 2024
1 parent be0678e commit df39db3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weasyprint/text/ffi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Imports of dynamic libraries used for text layout."""

import os
import sys
from contextlib import suppress

import cffi
Expand Down Expand Up @@ -434,7 +435,7 @@ def _dlopen(ffi, *names, allow_fail=False):
return ffi.dlopen(names[0], flags) # pragma: no cover


if hasattr(os, 'add_dll_directory'): # pragma: no cover
if hasattr(os, 'add_dll_directory') and not hasattr(sys, 'frozen'): # pragma: no cover
dll_directories = os.getenv(
'WEASYPRINT_DLL_DIRECTORIES',
'C:\\msys64\\mingw64\\bin;'
Expand Down

0 comments on commit df39db3

Please sign in to comment.