File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717# You should have received a copy of the GNU General Public License
1818# along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
20+ import sys
21+ import glob
22+
23+ def _enable_python_version_fallback ():
24+ """
25+ Append site-packages from other python versions to sys.path
26+ to allow importing modules not yet available in the current version.
27+ """
28+ # glob pattern for site-packages
29+ # We assume standard linux paths: /usr/lib/pythonX.Y/site-packages
30+ paths = glob .glob ('/usr/lib/python3.*/site-packages' )
31+
32+ current_version_path = f"/usr/lib/python{ sys .version_info .major } .{ sys .version_info .minor } /site-packages"
33+
34+ for path in paths :
35+ if path == current_version_path :
36+ continue
37+
38+ if path not in sys .path :
39+ # Append to end of path to use as fallback
40+ sys .path .append (path )
41+
42+ _enable_python_version_fallback ()
43+
2044from bbv .main import Main
2145
2246if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments