1diff --git a/build.py b/build.py
2index 06905a11..56d54a17 100644
3--- a/build.py
4+++ b/build.py
5@@ -10,7 +10,7 @@ from optparse import OptionParser
6 import shutil
7 from multiprocessing import Pool
8
9-from setuptools import sandbox
10+import subprocess
11 from hscommon import sphinxgen
12 from hscommon.build import (
13 add_to_pythonpath,
14@@ -118,7 +118,12 @@ def build_normpo():
15 def build_pe_modules():
16 print("Building PE Modules")
17 # Leverage setup.py to build modules
18- sandbox.run_setup("setup.py", ["build_ext", "--inplace"])
19+ result = subprocess.run(
20+ [sys.executable, "setup.py", "build_ext", "--inplace"],
21+ check=True,
22+ )
23+ if result.returncode != 0:
24+ sys.exit("Error building PE modules. Please check the output above.")
25
26
27 def build_normal():