Skip to content

Commit

Permalink
building: Allow usage of VSVersionInfo again.
Browse files Browse the repository at this point in the history
Fixes pyinstaller#4381: The option to pass a VSVersionInfo object as version
argument to EXE was a feature that was explicitly implemented,
but was overlooked when attempts were made to make paths relative.
The bug is fixed by checking whether the object passed as version
argument is a VSVersionInfo object. This change explicitly only
checks if it is a VSVersionInfo object, if not it is still assumed
to be a path-like object.
  • Loading branch information
Chrisg2000 authored and htgoebel committed Nov 26, 2019
1 parent f814a70 commit 9dd34bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PyInstaller/building/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ def __init__(self, *args, **kwargs):
"", "OPTION"))

if self.versrsrc:
if not os.path.isabs(self.versrsrc):
if (not isinstance(self.versrsrc, versioninfo.VSVersionInfo)
and not os.path.isabs(self.versrsrc)):
# relative version-info path is relative to spec file
self.versrsrc = os.path.join(
CONF['specpath'], self.versrsrc)
Expand Down
1 change: 1 addition & 0 deletions news/4381.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(Windows) Allow usage of `VSVersionInfo` as version argument to EXE again.
1 change: 1 addition & 0 deletions news/4539.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(Windows) Allow usage of `VSVersionInfo` as version argument to EXE again.

0 comments on commit 9dd34bd

Please sign in to comment.