Skip to content

Commit 007f78f

Browse files
committed
Depend: Import 'pefile' only on windows.
This fixes building the documentation at read-the-docs: Since 835fd2e 'pefile' was imported unconditionally, even when running `pyinstaller --help`. And when building the docs this very command is run to generate the input for the man-pages. But 'pefile' is not available at read-the-docs and the build fails.
1 parent 3b3ae9a commit 007f78f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

PyInstaller/depend/bindepend.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import os
1616
import re
1717
import sys
18-
import pefile
1918
from glob import glob
2019
# Required for extracting eggs.
2120
import zipfile
@@ -26,23 +25,22 @@
2625
is_darwin, is_freebsd, is_venv, base_prefix, PYDYLIB_NAMES)
2726
from . import dylib, utils
2827

29-
3028
from .. import log as logging
3129
from ..utils.win32 import winutils
3230

3331
logger = logging.getLogger(__name__)
3432

3533
seen = set()
3634

37-
# Do not load all the directories information from the PE file
38-
pefile.fast_load = True
39-
4035
# Import windows specific stuff.
4136
if is_win:
4237
from ..utils.win32.winmanifest import RT_MANIFEST
4338
from ..utils.win32.winmanifest import GetManifestResources
4439
from ..utils.win32.winmanifest import Manifest
4540
from ..utils.win32 import winresource
41+
import pefile
42+
# Do not load all the directories information from the PE file
43+
pefile.fast_load = True
4644

4745

4846
def getfullnameof(mod, xtrapath=None):

0 commit comments

Comments
 (0)