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

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@gmail.com>2016-03-08 05:42:34 +0300
committersoumith <soumith@gmail.com>2016-03-08 05:42:34 +0300
commit9a41915d490dd6d6530c963911f56a81d64f850e (patch)
tree0db4b377308bb17cd3807155c122b17cc1a7feba
parent6706567b10f745eec57b5b4824558104c86d20ad (diff)
making sys optionalsysopt
-rw-r--r--Tester.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/Tester.lua b/Tester.lua
index 3eedc6b..c114bbf 100644
--- a/Tester.lua
+++ b/Tester.lua
@@ -1,6 +1,4 @@
-require 'sys' -- for sys.COLORS
-
-- Lua 5.2 compatibility
local unpack = unpack or table.unpack
@@ -380,7 +378,8 @@ end
local NCOLS = 80
local coloured
local c = {}
-if arg then -- have we been invoked from the commandline?
+local enable_colors = pcall(require, 'sys')
+if arg and enable_colors then -- have we been invoked from the commandline?
c = sys.COLORS
coloured = function(str, colour)
return colour .. str .. c.none