Updates of recent changes to logging.
[python.git] / Modules / getbuildinfo.c
blob0f71ca03d0a52894cd4817ea16ebe8048028a6b3
1 #include "Python.h"
3 #ifndef DONT_HAVE_STDIO_H
4 #include <stdio.h>
5 #endif
7 #ifndef DATE
8 #ifdef __DATE__
9 #define DATE __DATE__
10 #else
11 #define DATE "xx/xx/xx"
12 #endif
13 #endif
15 #ifndef TIME
16 #ifdef __TIME__
17 #define TIME __TIME__
18 #else
19 #define TIME "xx:xx:xx"
20 #endif
21 #endif
23 #define SVNVERSION "$WCRANGE$$WCMODS?M:$"
24 const char *
25 Py_GetBuildInfo(void)
27 static char buildinfo[50];
28 const char *revision = Py_SubversionRevision();
29 const char *sep = *revision ? ":" : "";
30 const char *branch = Py_SubversionShortBranch();
31 PyOS_snprintf(buildinfo, sizeof(buildinfo),
32 "%s%s%s, %.20s, %.9s", branch, sep, revision,
33 DATE, TIME);
34 return buildinfo;
37 const char *
38 _Py_svnversion(void)
40 /* the following string can be modified by subwcrev.exe */
41 static const char svnversion[] = SVNVERSION;
42 if (!strstr(svnversion, "$"))
43 return svnversion; /* it was interpolated */
44 return "exported";