diff --git a/source/KKRnano/regtests/run_test.sh b/source/KKRnano/regtests/run_test.sh
index 117c9a1277429a052cdbe6bd15419a991e8859ec..af7b9a6b7885945421024affac46f8994561d9bf 100755
--- a/source/KKRnano/regtests/run_test.sh
+++ b/source/KKRnano/regtests/run_test.sh
@@ -10,7 +10,7 @@ day=`date "+%Y%m%d%H%M"`
 rm -f ./last
 
 ## run the test scripts
-nohup python2.7 ./tests.py < /dev/null > ${day}_tests.txt
+nohup python3 ./tests.py < /dev/null > ${day}_tests.txt
 
 ## clean the working directory
 ./clearfiles.sh 
diff --git a/source/KKRnano/regtests/tests.py b/source/KKRnano/regtests/tests.py
index ede4da137b7696030b4fd4ae4c0e515ebfbfc278..92a9e5ce73de1688e2cc35250af3d96e65cad2d9 100755
--- a/source/KKRnano/regtests/tests.py
+++ b/source/KKRnano/regtests/tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 import unittest
 import subprocess
@@ -40,11 +40,11 @@ def get_energy(string):
           match = list(re.finditer(r"^.*TOTAL ENERGY in ryd. :(.*)$", string, re.M))[-1] # get last match only
     except:
           print(string)
-          raise ArgumentError
+          raise ValueError("Error getting energy from output")
     if match is not None:
           return float(match.group(1))
     else:
-          raise ArgumentError
+          raise ValueError("Error getting energy from output")
 
 def KKRnano(inputdir, nranks=DEFAULT_nranks, nthreads=DEFAULT_nthreads, solver=DEFAULT_solver, lmax=DEFAULT_lmax, Lly=DEFAULT_Lly, **kwargs):
     """Run KKR-calculation with input from 'inputdir' and returns the total energy"""