"""Prepend _internal to sys.path in frozen mode so local stdlib builds are found."""
import sys, os
from pathlib import Path

if getattr(sys, 'frozen', False):
    _meipass = Path(sys._MEIPASS)
    _internal = _meipass / '_internal'
    if _internal.exists():
        _path = str(_internal)
        if _path not in sys.path:
            sys.path.insert(0, _path)