From ee99fc4446edbdfd7ca72853cec9154d760c5ecb Mon Sep 17 00:00:00 2001 From: Vanya Sergeev Date: Sat, 6 Feb 2016 02:09:44 -0800 Subject: 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]: ? $ --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3