Show More
@@ -55,9 +55,9 b' from IPython.iplib import InteractiveShell' | |||||
55 | from IPython.usage import cmd_line_usage,interactive_usage |
|
55 | from IPython.usage import cmd_line_usage,interactive_usage | |
56 | from IPython.genutils import * |
|
56 | from IPython.genutils import * | |
57 |
|
57 | |||
58 | def force_import(modname): |
|
58 | def force_import(modname,force_reload=False): | |
59 | if modname in sys.modules: |
|
59 | if modname in sys.modules and force_reload: | |
60 |
|
|
60 | info("reloading: %s" % modname) | |
61 | reload(sys.modules[modname]) |
|
61 | reload(sys.modules[modname]) | |
62 | else: |
|
62 | else: | |
63 | __import__(modname) |
|
63 | __import__(modname) | |
@@ -625,25 +625,25 b" object? -> Details about 'object'. ?object also works, ?? prints more." | |||||
625 | except: |
|
625 | except: | |
626 | IP.InteractiveTB() |
|
626 | IP.InteractiveTB() | |
627 | import_fail_info('ipy_system_conf') |
|
627 | import_fail_info('ipy_system_conf') | |
628 |
|
628 | |||
629 | # only import prof module if ipythonrc-PROF was not found |
|
629 | # only import prof module if ipythonrc-PROF was not found | |
630 | if opts_all.profile and not profile_handled_by_legacy: |
|
630 | if opts_all.profile and not profile_handled_by_legacy: | |
631 | profmodname = 'ipy_profile_' + opts_all.profile |
|
631 | profmodname = 'ipy_profile_' + opts_all.profile | |
632 | try: |
|
632 | try: | |
633 |
|
||||
634 | force_import(profmodname) |
|
633 | force_import(profmodname) | |
635 | except: |
|
634 | except: | |
636 | IP.InteractiveTB() |
|
635 | IP.InteractiveTB() | |
637 |
print "Error importing",profmodname, |
|
636 | print "Error importing",profmodname,\ | |
|
637 | "- perhaps you should run %upgrade?" | |||
638 | import_fail_info(profmodname) |
|
638 | import_fail_info(profmodname) | |
639 | else: |
|
639 | else: | |
640 | opts.profile = opts_all.profile |
|
640 | opts.profile = opts_all.profile | |
641 | else: |
|
641 | else: | |
642 | force_import('ipy_profile_none') |
|
642 | force_import('ipy_profile_none') | |
|
643 | # XXX - this is wrong: ipy_user_conf should not be loaded unconditionally, | |||
|
644 | # since the user could have specified a config file path by hand. | |||
643 | try: |
|
645 | try: | |
644 |
|
||||
645 | force_import('ipy_user_conf') |
|
646 | force_import('ipy_user_conf') | |
646 |
|
||||
647 | except: |
|
647 | except: | |
648 | conf = opts_all.ipythondir + "/ipy_user_conf.py" |
|
648 | conf = opts_all.ipythondir + "/ipy_user_conf.py" | |
649 | IP.InteractiveTB() |
|
649 | IP.InteractiveTB() |
General Comments 0
You need to be logged in to leave comments.
Login now