only change LD vars if running from bundle

missed a word


moved is_running_from_bundle
This commit is contained in:
Brannon King 2020-03-06 11:31:17 -07:00 committed by Jack Robison
parent dec248adec
commit 212c8f188d
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 11 additions and 1 deletions

View file

@ -7,6 +7,8 @@ import re
import shlex
import shutil
import platform
import lbry.utils
from lbry.conf import TranscodeConfig
log = logging.getLogger(__name__)
@ -28,6 +30,8 @@ class VideoFileAnalyzer:
self._which = None
self._checked_ffmpeg = False
self._env_copy = dict(os.environ)
if lbry.utils.is_running_from_bundle():
# handle the situation where PyInstaller overrides our runtime environment:
self._replace_or_pop_env('LD_LIBRARY_PATH')
async def _execute(self, command, arguments):

View file

@ -4,6 +4,7 @@ import datetime
import random
import socket
import string
import sys
import json
import typing
import asyncio
@ -276,3 +277,8 @@ async def get_external_ip() -> typing.Optional[str]: # used if upnp is disabled
return response['data']['ip']
except Exception:
return
def is_running_from_bundle():
# see https://pyinstaller.readthedocs.io/en/stable/runtime-information.html
return getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS')