Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/trepl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanya Sergeev <vsergeev@gmail.com>2016-02-06 13:09:44 +0300
committerVanya Sergeev <vsergeev@gmail.com>2016-02-06 13:10:45 +0300
commitee99fc4446edbdfd7ca72853cec9154d760c5ecb (patch)
tree88e5c0ff7e7551da9b4c2ef43c50b3301de3d96e
parent1ae1458706758122c1358193bd2945e31bddc62c (diff)
Fix running in torch-less env with stub for torch.setheaptracking()
This commit stubs out torch.setheaptracking(), so trepl can be run in a torch-less environment. It fixes the following error: $ th /usr/bin/lua5.1: /usr/share/lua/5.1/trepl/init.lua:692: attempt to call field 'setheaptracking' (a nil value) stack traceback: /usr/share/lua/5.1/trepl/init.lua:692: in main chunk [C]: in function 'require' /usr/lib/luarocks/rocks-5.1/trepl/scm-1/bin/th:104: in main chunk [C]: ? $
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index a043fe5..8255873 100644
--- a/init.lua
+++ b/init.lua
@@ -132,7 +132,8 @@ local selfhelp = [[
-- If no Torch:
if not torch then
torch = {
- typename = function() return '' end
+ typename = function() return '' end,
+ setheaptracking = function() end
}
end