only change LD vars if running from bundle
missed a word moved is_running_from_bundle
This commit is contained in:
parent
dec248adec
commit
212c8f188d
2 changed files with 11 additions and 1 deletions
|
@ -7,6 +7,8 @@ import re
|
||||||
import shlex
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
import lbry.utils
|
||||||
from lbry.conf import TranscodeConfig
|
from lbry.conf import TranscodeConfig
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -28,7 +30,9 @@ class VideoFileAnalyzer:
|
||||||
self._which = None
|
self._which = None
|
||||||
self._checked_ffmpeg = False
|
self._checked_ffmpeg = False
|
||||||
self._env_copy = dict(os.environ)
|
self._env_copy = dict(os.environ)
|
||||||
self._replace_or_pop_env('LD_LIBRARY_PATH')
|
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):
|
async def _execute(self, command, arguments):
|
||||||
if DISABLED:
|
if DISABLED:
|
||||||
|
|
|
@ -4,6 +4,7 @@ import datetime
|
||||||
import random
|
import random
|
||||||
import socket
|
import socket
|
||||||
import string
|
import string
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import typing
|
import typing
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -276,3 +277,8 @@ async def get_external_ip() -> typing.Optional[str]: # used if upnp is disabled
|
||||||
return response['data']['ip']
|
return response['data']['ip']
|
||||||
except Exception:
|
except Exception:
|
||||||
return
|
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')
|
||||||
|
|
Loading…
Add table
Reference in a new issue