diff --git a/pre_commit/languages/lua.py b/pre_commit/languages/lua.py index 3b599f816..ae322279b 100644 --- a/pre_commit/languages/lua.py +++ b/pre_commit/languages/lua.py @@ -66,7 +66,8 @@ def _get_lua_path_version( # This could sniff out from _VERSION, but checking package.path should # provide an answer for *exactly* where lua is looking for packages. _, stdout, _ = cmd_output(lua_executable, '-e', 'print(package.path)') - match = re.search(fr'{os.sep}lua{os.sep}(.*?){os.sep}', stdout) + sep = os.sep if os.name != 'nt' else os.sep * 2 + match = re.search(fr'{sep}lua{sep}(.*?){sep}', stdout) if match: return match[1]