diff --git a/tools/wpt/virtualenv.py b/tools/wpt/virtualenv.py index a894c9c68d276e..400debc88e4691 100644 --- a/tools/wpt/virtualenv.py +++ b/tools/wpt/virtualenv.py @@ -90,7 +90,8 @@ def working_set(self): def activate(self): path = os.path.join(self.bin_path, "activate_this.py") - execfile(path, {"__file__": path}) # noqa: F821 + with open(path) as f: + exec(f.read(), {"__file__": path}) def start(self): if not self.exists or self.broken_link: