X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmc_type.py;h=d2e98843390068e52df3e42f8c9ae01a12eff465;hb=HEAD;hp=dbcf94d5ab3eeaa8372ca779b546e96e89c57279;hpb=589908a77e5c7b0ddeaa4a1149e3453b05fe97a8;p=dotfiles.git diff --git a/bin/mc_type.py b/bin/mc_type.py index dbcf94d..d2e9884 100755 --- a/bin/mc_type.py +++ b/bin/mc_type.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 import sys, subprocess @@ -13,6 +13,8 @@ stdout, stderr = mc.communicate() if mc.returncode or stderr: sys.exit('Error reading mc version: (%d) %s' % (mc.returncode, stderr)) +if not isinstance(stdout, type('')): + stdout = stdout.decode() mc_version = stdout.split('\n')[0] if mc_version.startswith('Midnight Commander'): mc_version = mc_version.split()[2]