cubicweb/migration.py
changeset 11286 0b38e373b985
parent 11057 0b59724cb3f2
child 11767 432f87a63057
equal deleted inserted replaced
11285:581b5b64b382 11286:0b38e373b985
   267                 pass
   267                 pass
   268         from code import interact
   268         from code import interact
   269         banner = """entering the migration python shell
   269         banner = """entering the migration python shell
   270 just type migration commands or arbitrary python code and type ENTER to execute it
   270 just type migration commands or arbitrary python code and type ENTER to execute it
   271 type "exit" or Ctrl-D to quit the shell and resume operation"""
   271 type "exit" or Ctrl-D to quit the shell and resume operation"""
   272         # give custom readfunc to avoid http://bugs.python.org/issue1288615
   272         interact(banner, local=local_ctx)
   273         def unicode_raw_input(prompt):
       
   274             return unicode(raw_input(prompt), sys.stdin.encoding)
       
   275         interact(banner, readfunc=unicode_raw_input, local=local_ctx)
       
   276         try:
   273         try:
   277             readline.write_history_file(histfile)
   274             readline.write_history_file(histfile)
   278         except IOError:
   275         except IOError:
   279             pass
   276             pass
   280         # delete instance's confirm attribute to avoid questions
   277         # delete instance's confirm attribute to avoid questions