Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WLua: Handle LUA error with %Z date format on Windows #950

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion generator/mavgen_wlua.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def generate_preamble(outf):
d = os.date("%Y-%m-%d %H:%M:%S",value:tonumber() / 1000000.0)
us = value % 1000000
us = string.format("%06d",us:tonumber())
tz = os.date(" %Z",value:tonumber() / 1000000.0)
ok, tz = pcall(os.date," %Z",value:tonumber() / 1000000.0)
if not ok then
tz = os.date(" %z",value:tonumber() / 1000000.0)
end
return " (" .. d .. "." .. us .. tz .. ")"
elseif value < 1000000 then
return ""
Expand Down
Loading