From bfb1d296ccb481148121d61fa3c6c33791d14b01 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 3 Aug 2020 19:07:17 -0400 Subject: [PATCH] sys.platform="msys" compatibility. --- open_rfork.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/open_rfork.py b/open_rfork.py index b989efb..da8e24c 100644 --- a/open_rfork.py +++ b/open_rfork.py @@ -85,7 +85,7 @@ if sys.platform == "win32": return True -if sys.platform == "darwin": +elif sys.platform == "darwin": def open_rfork(file, mode="r"): file = os.path.realpath(file) rfile = file + "/..namedfork/rsrc" @@ -106,7 +106,7 @@ if sys.platform == "darwin": if ok < 0: return False return True -if sys.platform == "linux": +elif sys.platform == "linux": def open_rfork(file, mode="r"): raise NotImplementedError("open_rfork") @@ -115,3 +115,10 @@ if sys.platform == "linux": data = struct.pack(">8s24x", _make_finder_data(filetype, auxtype)) os.setxattr(path, "com.apple.FinderInfo", data, 0, 0) return True + +else: + def open_rfork(file, mode="r"): + raise NotImplementedError("open_rfork") + + def set_file_type(path, filetype, auxtype): + raise NotImplementedError("set_file_type")