diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h
index 01abfa9..e286d17 100644
--- a/Include/pylifecycle.h
+++ b/Include/pylifecycle.h
@@ -64,6 +64,7 @@ int _Py_CheckPython3();
 #endif
 
 /* In their own files */
+PyAPI_FUNC(const char *) IDP_GetVersion(void);
 PyAPI_FUNC(const char *) Py_GetVersion(void);
 PyAPI_FUNC(const char *) Py_GetPlatform(void);
 PyAPI_FUNC(const char *) Py_GetCopyright(void);
diff --git a/Lib/platform.py b/Lib/platform.py
index cc2db98..b205329 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -1087,6 +1087,7 @@ def processor():
 
 _sys_version_parser = re.compile(
     r'([\w.+]+)\s*'  # "version<space>"
+    r'(?:\|[^|]*\|)?\s*' # version extra
     r'\(#?([^,]+)'  # "(#buildno"
     r'(?:,\s*([\w ]*)'  # ", builddate"
     r'(?:,\s*([\w :]*))?)?\)\s*'  # ", buildtime)<space>"
diff --git a/Modules/main.c b/Modules/main.c
index 947c9a5..0afd374 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -532,7 +532,8 @@ Py_Main(int argc, wchar_t **argv)
         return usage(0, argv[0]);
 
     if (version) {
-        printf("Python %s\n", version >= 2 ? Py_GetVersion() : PY_VERSION);
+        Py_SetProgramName(argv[0]);
+        fprintf(stderr, "Python %s :: %s\n", PY_VERSION, IDP_GetVersion());
         return 0;
     }
 
diff --git a/Python/getversion.c b/Python/getversion.c
index 7bd6efd..bbcffa9 100644
--- a/Python/getversion.c
+++ b/Python/getversion.c
@@ -3,13 +3,53 @@
 
 #include "Python.h"
 
+#include "osdefs.h"
 #include "patchlevel.h"
 
+#ifdef MS_WIN32
+#define STDLIB_DIR  L"\\Lib\\"
+#else
+#define STDLIB_DIR  L"/lib/python3.6/"
+#endif
+
+const char *
+IDP_GetVersion(void)
+{
+    static char res[128];
+    FILE *f;
+    wchar_t path[MAXPATHLEN+1];
+    int c, i;
+
+    wcscpy(path, Py_GetPrefix());
+    wcscat(path, STDLIB_DIR L"version.txt");
+
+    f = _Py_wfopen(path, L"rb");
+    if (f == NULL) {
+        strcpy(res, "Intel Corporation");
+    }
+    else {
+        i = 0;
+        while (i + 1 < sizeof(res)) {
+            c = fgetc(f);
+            if (c == EOF || c == '\n' || c == '\r')
+                break;
+            res[i++] = c;
+        }
+        fclose(f);
+        res[i] = '\0';
+    }
+    return res;
+}
+
 const char *
 Py_GetVersion(void)
 {
-	static char version[250];
-	PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
-		      PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
-	return version;
+    static char version[250];
+
+    PyOS_snprintf(version, sizeof(version), "%.80s |%s| (%.80s) %.80s",
+                  PY_VERSION, IDP_GetVersion(),
+                  Py_GetBuildInfo(), Py_GetCompiler());
+    return version;
 }
+
+#undef STDLIB_DI
