33 if isinstance( value, NameError ):
34 res = _NAMEREX.search( str(value) )
36 cmd = res.group( _NAME )
39 if cmd
in _unacceptable:
42 elif isinstance( value, SyntaxError ):
51 if exe ==
'cd' and len(args) == 2:
53 log.info(
'new directory: %s', os.getcwd() )
56 if exe ==
'help' and len(args) == 2:
58 exec (
'help( %s )' % args[1]
in __main__.__dict__, __main__.__dict__)
62 if exe
not in _shellCommands:
63 log.debug(
'accepting executable "%s"', exe )
64 if unixtools.which( exe ):
65 _shellCommands.append( exe )
70 log.debug(
'executing shell command "%s"', cmd )