projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b69fa1f
)
Backport fix from default branch for ./python -R -Wd where hash('d') would not
author
Barry Warsaw
<barry@python.org>
Tue, 21 Feb 2012 16:16:06 +0000
(11:16 -0500)
committer
Barry Warsaw
<barry@python.org>
Tue, 21 Feb 2012 16:16:06 +0000
(11:16 -0500)
have gotten randomized.
Modules/main.c
patch
|
blob
|
history
diff --git
a/Modules/main.c
b/Modules/main.c
index a57d00b359df24490325246505c1061cdc386402..780d877b518c57ea81986cc88558bc00b6e688d1 100644
(file)
--- a/
Modules/main.c
+++ b/
Modules/main.c
@@
-396,6
+396,12
@@
Py_Main(int argc, char **argv)
case 'W':
PySys_AddWarnOption(_PyOS_optarg);
+ /* Extremely obscure hack: if _PyOS_optarg was one character,
+ PyString_FromString in PySys_AddWarnOption will try to intern
+ it. This is bad because hash randomization has not been setup
+ yet, so the string will get the wrong hash. The following call
+ will cause all the cached characters to be released. */
+ PyString_Fini();
break;
case 'R':