File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414local version_vault_url = " https://vault.vfox.dev/python/pyenv"
1515local uv_build_vault_url = " https://vault.vfox.dev/python/uv-build"
1616local UV_BUILD_GITHUB_RELEASE_PATTERN = " /releases/download/([^/]+)/([^/]+)$"
17+ local SHA256_HEX_LENGTH = 64
1718
1819-- request headers
1920local REQUEST_HEADERS = {
@@ -462,18 +463,15 @@ local function verifyUvBuildArchive(path, sha256)
462463 error (" Unable to verify uv-build archive sha256 for " .. path .. " : certutil command could not be started" )
463464 end
464465
465- local readOk , output = pcall (function ()
466- local data = handle :read (" *a" )
467- handle :close ()
468- return data
469- end )
470- if not readOk or output == nil then
466+ local output = handle :read (" *a" )
467+ handle :close ()
468+ if output == nil then
471469 error (" Unable to verify uv-build archive sha256 for " .. path .. " : failed to read certutil output" )
472470 end
473471 local actualSha256
474472 for line in string.gmatch (output , " [^\r\n ]+" ) do
475473 local normalizedLine = string.gsub (string.lower (line ), " %s+" , " " )
476- if string.match (normalizedLine , " ^[0-9a-f]+$" ) and string.len (normalizedLine ) == 64 then
474+ if string.match (normalizedLine , " ^[0-9a-f]+$" ) and string.len (normalizedLine ) == SHA256_HEX_LENGTH then
477475 actualSha256 = normalizedLine
478476 break
479477 end
You can’t perform that action at this time.
0 commit comments