##// END OF EJS Templates
use explicit checking instead of tr/except
Matthias Bussonnier -
Show More
@@ -1435,9 +1435,9 b' class InteractiveShell(SingletonConfigurable):'
1435 drop_keys.discard('__name__')
1435 drop_keys.discard('__name__')
1436 for k in drop_keys:
1436 for k in drop_keys:
1437 del ns[k]
1437 del ns[k]
1438
1438
1439 self.user_ns_hidden.clear()
1439 self.user_ns_hidden.clear()
1440
1440
1441 # Restore the user namespaces to minimal usability
1441 # Restore the user namespaces to minimal usability
1442 self.init_user_ns()
1442 self.init_user_ns()
1443
1443
@@ -1450,9 +1450,7 b' class InteractiveShell(SingletonConfigurable):'
1450 # GUI or web frontend
1450 # GUI or web frontend
1451 if os.name == 'posix':
1451 if os.name == 'posix':
1452 for cmd in ('clear', 'more', 'less', 'man'):
1452 for cmd in ('clear', 'more', 'less', 'man'):
1453 try:
1453 if cmd not in self.magics_manager.magics['line']:
1454 name = self.magics_manager.magics['line'][cmd]
1455 except KeyError:
1456 self.alias_manager.soft_define_alias(cmd, cmd)
1454 self.alias_manager.soft_define_alias(cmd, cmd)
1457
1455
1458 # Flush the private list of module references kept for script
1456 # Flush the private list of module references kept for script
General Comments 0
You need to be logged in to leave comments. Login now