| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,5 +101,6 @@ def exec_code(interpreter, args): | |||
| 101 | 101 | with open(args[0], 'r') as sourcefile: | |
| 102 | 102 | code_obj = compile(sourcefile.read(), args[0], 'exec') | |
| 103 | 103 | old_argv, sys.argv = sys.argv, args | |
| 104 | + sys.path.insert(0, os.path.abspath(os.path.dirname(args[0]))) | ||
| 104 | 105 | interpreter.runcode(code_obj) | |
| 105 | 106 | sys.argv = old_argv | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1548,13 +1548,14 @@ def main_curses(scr, args, config, interactive=True, locals_=None, | |||
| 1548 | 1548 | sys.stdout = repl | |
| 1549 | 1549 | sys.stderr = repl | |
| 1550 | 1550 | ||
| 1551 | - repl.startup() | ||
| 1552 | - | ||
| 1553 | 1551 | if args: | |
| 1554 | 1552 | bpython.args.exec_code(interpreter, args) | |
| 1555 | 1553 | if not interactive: | |
| 1556 | 1554 | curses.raw(False) | |
| 1557 | 1555 | return repl.getstdout() | |
| 1556 | + else: | ||
| 1557 | + sys.path.insert(0, '') | ||
| 1558 | + repl.startup() | ||
| 1558 | 1559 | ||
| 1559 | 1560 | if banner is not None: | |
| 1560 | 1561 | repl.write(banner) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -637,7 +637,10 @@ def main(args=None): | |||
| 637 | 637 | sys.stdout = repl_widget | |
| 638 | 638 | ||
| 639 | 639 | gobject.idle_add(init_import_completion) | |
| 640 | - gobject.idle_add(repl_widget.startup) | ||
| 640 | + | ||
| 641 | + if not args: | ||
| 642 | + sys.path.insert(0, '') | ||
| 643 | + gobject.idle_add(repl_widget.startup) | ||
| 641 | 644 | ||
| 642 | 645 | if not options.socket_id: | |
| 643 | 646 | parent = gtk.Window() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -296,7 +296,6 @@ def __init__(self, interp, config, idle=None): | |||
| 296 | 296 | self.list_win_visible = False | |
| 297 | 297 | self._C = {} | |
| 298 | 298 | self.prev_block_finished = 0 | |
| 299 | - sys.path.insert(0, '.') | ||
| 300 | 299 | ||
| 301 | 300 | pythonhist = os.path.expanduser(self.config.hist_file) | |
| 302 | 301 | if os.path.exists(pythonhist): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,7 @@ Show the help message and exit. | |||
| 70 | 70 | .IP "\fB\-\-interactive\fR" 4 | |
| 71 | 71 | .PD | |
| 72 | 72 | Drop to bpython shell after running \fIfile\fR instead of exiting. | |
| 73 | + The PYTHONSTARTUP file is not read. | ||
| 73 | 74 | .IP "\fB\-q\fR" 4 | |
| 74 | 75 | .PD 0 | |
| 75 | 76 | .IP "\fB\-\-quiet\fR" 4 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments