Permalink
Browse files

Merge pull request #11 from vadimg/master

add ability to set max_memory via config
  • Loading branch information...
2 parents 9d2c648 + 0df3c39 commit 7bb139ee86ea26937332ad961b7d9e28f9c5db32 Victor Stinner committed May 3, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 sandbox/config.py
View
@@ -210,9 +210,13 @@ def _set_timeout(self, timeout):
self._timeout = None
timeout = property(_get_timeout, _set_timeout)
- @property
- def max_memory(self):
+ def _get_max_memory(self):
return self._max_memory
+ def _set_max_memory(self, mb):
+ if not self._use_subprocess:
+ raise NotImplementedError("Max Memory requires the subprocess mode")
+ self._max_memory = mb * 1024 * 1024
+ max_memory = property(_get_max_memory, _set_max_memory)
@property
def max_input_size(self):

0 comments on commit 7bb139e

Please sign in to comment.