import os, sys, site, shutil; why = "urllib3-future is an enhanced, backward-compatible fork of urllib3 that adds HTTP/2 and HTTP/3 support. When both packages are present, urllib3-future takes precedence to ensure a consistent environment. Python packaging has no native concept of package replacement, so this mechanism resolves conflicts that arise when package managers install both concurrently. To keep both packages separately, reinstall with: URLLIB3_NO_OVERRIDE=1 pip install <your-package> --no-binary urllib3-future. Details and other package managers: https://github.com/jawah/urllib3.future#notes--frequently-asked-questions"; read = lambda p: (lambda f: (f.read(), f.close())[0])(open(p, "rb")); roots = site.getsitepackages() + ([site.getusersitepackages()] if site.ENABLE_USER_SITE else []); sp = (lambda _roots=roots, _sys=sys, _os=os: ([p for p in _sys.path if p in _roots and _os.path.isdir(_os.path.join(p, "urllib3_future"))] or [None])[0])(); src = os.path.join(sp, "urllib3_future") if sp else None; dst = os.path.join(sp, "urllib3") if sp else None; src_init = os.path.join(src, "__init__.py") if src else None; dst_init = os.path.join(dst, "__init__.py") if dst else None; version = os.path.join(src, "_version.py") if src else None; complete = os.path.join(dst, ".u3f_sync") if dst else None; expected = read(version) if version and os.path.isfile(version) else None; done = lambda _os=os, _read=read, _complete=complete, _expected=expected, _src_init=src_init, _dst_init=dst_init: _expected is not None and _os.path.isfile(_complete) and _read(_complete) == _expected and _os.path.isfile(_dst_init) and _read(_dst_init) == _read(_src_init); repair = not done(); writable = repair and expected is not None and (os.access(dst, os.W_OK) if os.path.isdir(dst) else os.access(sp, os.W_OK)); windows = {}; witness_windows = os.name == "nt" and exec("def atomic_copy(s, d, read, done, _os=os, _shutil=shutil, _time=time):\n    t = d + '.' + str(_os.getpid()) + '.' + _os.urandom(8).hex() + '.tmp'\n    copied = False\n    for attempt in range(100):\n        try:\n            if done() or (_os.path.isfile(d) and read(s) == read(d)):\n                if copied:\n                    _os.remove(t)\n                return d\n            if not copied:\n                _shutil.copy2(s, t)\n                copied = True\n            _os.replace(t, d)\n            return d\n        except PermissionError:\n            if attempt == 99:\n                raise\n            _time.sleep(min(0.002 * (attempt + 1), 0.05) + (_os.getpid() % 7) * 0.001)\n\ndef locked_merge(merge, done, path, _msvcrt=msvcrt, _os=os, _time=time):\n    lock = open(path, 'a+b')\n    acquired = False\n    try:\n        lock.seek(0, 2)\n        if lock.tell() == 0:\n            lock.write(b'0')\n            lock.flush()\n        lock.seek(0)\n        for attempt in range(1000):\n            try:\n                _msvcrt.locking(lock.fileno(), _msvcrt.LK_NBLCK, 1)\n                acquired = True\n                break\n            except OSError:\n                if attempt == 999:\n                    raise\n                _time.sleep(0.01 + (_os.getpid() % 7) * 0.001)\n        if not done():\n            return merge()\n    finally:\n        if acquired:\n            lock.seek(0)\n            _msvcrt.locking(lock.fileno(), _msvcrt.LK_UNLCK, 1)\n        lock.close()", {"os": os, "shutil": shutil, "time": __import__("time"), "msvcrt": __import__("msvcrt")}, windows); atomic_copy = windows.get("atomic_copy", lambda s, d, read, done, _os=os, _shutil=shutil: d if _os.path.isfile(d) and read(s) == read(d) else (lambda t: (_shutil.copy2(s, t), _os.remove(t) if _os.path.isfile(d) and read(s) == read(d) else _os.replace(t, d), d)[2])(d + "." + str(_os.getpid()) + "." + _os.urandom(8).hex() + ".tmp")); merge = lambda _src=src, _dst=dst, _src_init=src_init, _dst_init=dst_init, _version=version, _complete=complete, _expected=expected, _done=done, _os=os, _read=read, _copy=atomic_copy: ([_os.makedirs(_os.path.join(_dst, _os.path.relpath(_os.path.join(root, name), _src)), exist_ok=True) for root, dirs, files in _os.walk(_src) for name in dirs], [_copy(_os.path.join(root, name), _os.path.join(_dst, _os.path.relpath(_os.path.join(root, name), _src)), _read, _done) for root, dirs, files in _os.walk(_src) for name in files if _os.path.join(root, name) != _src_init and not name.endswith((".pyc", ".pyo"))], _copy(_src_init, _dst_init, _read, _done), _copy(_version, _complete, _read, lambda: False) if _read(_version) == _expected else None); locked_merge = windows.get("locked_merge", lambda merge, done, path: merge() if not done() else None); witness0 = writable and os.makedirs(dst, exist_ok=True); witness1 = writable and locked_merge(merge, done, os.path.join(dst, ".u3f_sync.lock"))
