Skip to content

Commit 7ddd55a

Browse files
committed
Fix a debugging log message
We were incorrectly printing that a 3.13.7 process was 3.13.70 because we would always print the serial number (always 0 for a final release) whenever the release level was not a null string - and for final releases, we had it set to the empty string. Fix this to check for empty strings, instead, and ensure we never set it to a null string, instead using a recognizable sentinel for invalid release levels. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
1 parent 134db1d commit 7ddd55a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pystack/_pystack/process.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ operator<<(std::ostream& out, const ParsedPyVersion& version)
8080
// Use a temporary stringstream in case `out` is using hex or showbase
8181
std::ostringstream oss;
8282
oss << version.major << "." << version.minor << "." << version.patch;
83-
if (version.release_level) {
83+
if (version.release_level[0]) {
8484
oss << version.release_level << version.serial;
8585
}
8686

@@ -97,7 +97,7 @@ parsePyVersionHex(uint64_t version, ParsedPyVersion& parsed)
9797
int level = (version >> 4) & 0x0F;
9898
int count = (version >> 0) & 0x0F;
9999

100-
const char* level_str = nullptr;
100+
const char* level_str = "(unknown release level)";
101101
if (level == 0xA) {
102102
level_str = "a";
103103
} else if (level == 0xB) {

0 commit comments

Comments
 (0)