diff --git a/mitmproxy/platform/osx.py b/mitmproxy/platform/osx.py index b5dce7936..6a555f32e 100644 --- a/mitmproxy/platform/osx.py +++ b/mitmproxy/platform/osx.py @@ -23,12 +23,12 @@ class Resolver(object): try: stxt = subprocess.check_output(self.STATECMD, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: - if "sudo: a password is required" in e.output: + if "sudo: a password is required" in e.output.decode(errors="replace"): insufficient_priv = True else: raise RuntimeError("Error getting pfctl state: " + repr(e)) else: - insufficient_priv = "sudo: a password is required" in stxt + insufficient_priv = "sudo: a password is required" in stxt.decode(errors="replace") if insufficient_priv: raise RuntimeError(