Date: Friday, January 20, 2023 @ 19:04:31
  Author: jelle
Revision: 1387144

Remove hardcoded python version strings

Modified:
  thefuck/trunk/PKGBUILD

----------+
 PKGBUILD |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-01-20 19:00:15 UTC (rev 1387143)
+++ PKGBUILD    2023-01-20 19:04:31 UTC (rev 1387144)
@@ -28,7 +28,8 @@
   # Hack $HOME as it's / in the chroot and not writable
   cp tests/test_conf.py "$srcdir/test_conf.py.bak"
   sed -i "s|data = {}|data = {'HOME': '$srcdir'}|" tests/test_conf.py
-  LC_CTYPE=en_US.utf8 
PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH" 
py.test tests
+  local python_version=$(python -c 'import sys; print(".".join(map(str, 
sys.version_info[:2])))')
+  LC_CTYPE=en_US.utf8 
PYTHONPATH="$PWD/tmp_install/usr/lib/python${python_version}/site-packages:$PYTHONPATH"
 py.test tests
   mv "$srcdir/test_conf.py.bak" tests/test_conf.py
 }
 

Reply via email to