diff --git a/envsetup.py b/envsetup.py
index 2cc3f7a8b1d2137134024c297290f9b91381418d..40ac86e4bf5993c07c7f5f09211b432fef711f04 100755
--- a/envsetup.py
+++ b/envsetup.py
@@ -5,6 +5,7 @@ Environment setup script for MediaServer
 '''
 import imp
 import os
+import subprocess
 import sys
 import traceback
 
@@ -64,8 +65,8 @@ class EnvSetup():
         self.debug = '-d' in args
         if self.debug:
             args.remove('-d')
-        code, out = utils.exec_cmd(['whoami'])
-        if out != 'root' and not self.debug:
+        whoami = subprocess.check_output(['whoami']).decode('utf-8')
+        if whoami != 'root' and not self.debug:
             log('This script should be run as root user.')
             sys.exit(1)
         # Load conf
diff --git a/tester.py b/tester.py
index 43b9cca1178529089df15bd194e697cd5f28d746..1dbf7bf7f4e73985eb50dff1ff2bd919e2990b22 100755
--- a/tester.py
+++ b/tester.py
@@ -60,8 +60,8 @@ class Tester():
         debug = '-d' in args
         if debug:
             args.remove('-d')
-        code, out = utils.exec_cmd(['whoami'])
-        if out != 'root' and not debug:
+        whoami = subprocess.check_output(['whoami']).decode('utf-8')
+        if whoami != 'root' and not debug:
             log('This script should be run as root user.')
             sys.exit(1)
         # Load conf