Work around `__file__` `NameError` thrown by `bbfreeze`. Fixes #5172.
Merge pull request #5184 from s0undt3ch/develop

Work around `__file__` `NameError` thrown by `bbfreeze`. Fixes #5172.