[tor-commits] [tor-launcher/master] Wrap Ctypes import in a try/catch.

mikeperry at torproject.org mikeperry at torproject.org
Tue Jul 16 20:27:59 UTC 2013


commit 23f662965c7f6c9bc24cb3fd3c06848a2d41498c
Author: Mike Perry <mikeperry-git at fscked.org>
Date:   Tue Jul 16 13:27:08 2013 -0700

    Wrap Ctypes import in a try/catch.
    
    It throws an exception if ctypes is disabled during FF build.
---
 src/components/tl-process.js |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 91a5ec2..c4906e1 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -8,7 +8,8 @@ const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/ctypes.jsm");
+// ctypes can be disabled at build time
+try { Cu.import("resource://gre/modules/ctypes.jsm"); } catch(e) {}
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "TorLauncherUtil",



More information about the tor-commits mailing list