[core] Use str instead of unicode for password
@@ -720,9 +720,9 @@ def coerce_password_from_script(script):
p = subprocess.Popen(script, shell=True, stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
- if isinstance(stdout, bytes):
+ if sys.version_info[0] > 2 and isinstance(stdout, bytes):
stdout = stdout.decode('utf-8')
- if isinstance(stderr, bytes):
+ if sys.version_info[0] > 2 and isinstance(stderr, bytes):
stderr = stderr.decode('utf-8')
if p.returncode != 0:
