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

github.com/torch/sys.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@fb.com>2016-03-05 00:48:35 +0300
committersoumith <soumith@fb.com>2016-03-05 00:48:35 +0300
commitcadd701a56dc842b2eab5e6c62126ee4d016244b (patch)
treee3b637de87f5465055cbe901e8c596fc0ee4bddc
parent77f10a2b95f30a08e9a439532c508632b7893f79 (diff)
making sys.OS be protected
-rw-r--r--init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 17680d0..590975f 100644
--- a/init.lua
+++ b/init.lua
@@ -78,7 +78,8 @@ function sys.uname()
end
end
end
-sys.OS = sys.uname()
+local _, os = pcall(sys.uname)
+sys.OS = os
--------------------------------------------------------------------------------
-- ls (list dir)
@@ -174,4 +175,4 @@ sys.COLORS = {none = '\27[0m',
sys.dirname = paths.dirname
sys.concat = paths.concat
-return sys \ No newline at end of file
+return sys