diff --git a/bin/mn_run.py b/bin/mn_run.py
index 1d542d9b11df4c3a3cc754de92298dd5a562226b..14d1b597e134af14f8182beb5bb896c5b748966c 100755
--- a/bin/mn_run.py
+++ b/bin/mn_run.py
@@ -143,7 +143,8 @@ def setup(self):
 
         if self.options.custom:
             if not os.path.isfile(self.options.custom):
-                raise Exception('could not find custom file: %s' % custom)
+                raise Exception('could not find custom file: %s' %
+                    self.options.custom)
 
     def begin(self):
         '''Create and run mininet.'''