diff options
author | schlamar <marc.schlaich@gmail.com> | 2014-03-25 08:44:38 +0100 |
---|---|---|
committer | schlamar <marc.schlaich@gmail.com> | 2014-03-25 08:44:38 +0100 |
commit | b8da2d118ee1ea618a8981c7dadd8b295f43ef23 (patch) | |
tree | c844c42e0c5ba29422a335598ff6bdf5f28cac68 | |
parent | d36aa0c35ff63963a5b5866e5039305ddf2954ae (diff) | |
download | tox-b8da2d118ee1ea618a8981c7dadd8b295f43ef23.tar.gz |
Limit PYTHONHASHSEED to 1024 on Windows to prevent possible MemoryErrors.
See http://bugs.python.org/issue20954.
-rw-r--r-- | tox/_config.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tox/_config.py b/tox/_config.py index 3644d8b..9e16b7d 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -123,7 +123,8 @@ def prepare_parse(pkgname): parser.add_argument("--hashseed", action="store", metavar="SEED", default=None, help="set PYTHONHASHSEED to SEED before running commands. " - "Defaults to a random integer in the range 1 to 4294967295. " + "Defaults to a random integer in the range [1, 4294967295] " + "([1, 1024] on Windows). " "Passing 'noset' suppresses this behavior.") parser.add_argument("--force-dep", action="append", metavar="REQ", default=None, @@ -200,7 +201,10 @@ def get_homedir(): return None def make_hashseed(): - return str(random.randint(1, 4294967295)) + max_seed = 4294967295 + if sys.platform == 'win32': + max_seed = 1024 + return str(random.randint(1, max_seed)) class parseini: def __init__(self, config, inipath): |