Commit Graph

170 Commits

Author SHA1 Message Date
Jeong YunWon
9f4f8ad0ec PyTuple::elements into private 2020-01-06 02:34:56 +09:00
coolreader18
777542f7ec Directly instantiate exceptions in the vm.new_*_error functions 2019-12-28 01:31:24 -06:00
Noah
97c8d11092 Make PyResult<T> = Result<T, PyBaseExceptionRef> 2019-12-27 11:22:52 -06:00
Noah
cd726a2818 Cleanup exceptions a bit 2019-12-27 11:17:26 -06:00
yanganto
4c3642d19c Use enum for initialize parameters 2019-12-11 10:58:59 +08:00
yanganto
edf70924a9 Set initial parameter in PySettings
- Initialize VM after VM created
	- Some(true):
		VM will be created and initialized with the importers, which require external
		filesystem access
	- Some(false):
		VM will be created and initialized with the importers wihout external filesystem access
	- None:
		VM will be created but not initialized, so it is ready to be injected with modules.
		After injection, the `initialize_as_external` or `initialize_without_external`
		should be called, such that the VM will be ready to use.

- Prevent double initialize VM by `initialized` flag
2019-12-05 10:14:40 +08:00
yanganto
4003013026 Initalize VM in VirtualMachine::default()
- new and initalize as external in VirtualMachine::default()
- Implement VirtualMachine::without_external
- new, setup stdlib_inits, Initialize vm for wasm
2019-12-05 10:13:41 +08:00
yanganto
8a14abc445 Initialize hardcore modules and importlib
Initialize hardcore modules and importlib after vm created and
stdlib_inits setup
2019-12-05 10:13:41 +08:00
coolreader18
a07e0a14bd Use a BufWriter for dumping profile output 2019-12-03 23:09:07 -06:00
coolreader18
1edf7c85aa Cleanup some stuff related to the repl 2019-10-14 20:20:13 +00:00
coolreader18
e7a6b79023 Allow indenting by pressing tab 2019-10-08 21:32:02 -05:00
coolreader18
2220ed7e81 Abstract over the readline implementation 2019-10-08 21:32:02 -05:00
coolreader18
04a5aecc3d Move ShellHelper into another module 2019-10-08 18:28:26 -05:00
Noah
de7002a3e7 Don't show builtins when tabbing on an empty line 2019-10-08 17:51:16 -05:00
Noah
fc3e8c2483 Add tab autocompletion to the REPL 2019-10-08 17:50:38 -05:00
Syrus
32123b56d4 Improved PR based on feedback 2019-10-08 00:54:41 -07:00
Syrus
7495fc68ae Added support for WASI 2019-10-07 12:30:48 -07:00
Noah
e89d00f167 Correctly handle a SystemExit unwound to the top level of execution 2019-10-04 22:05:01 -05:00
coolreader18
5dd5b44b59 Use the rustyline prompt on redox 2019-09-10 18:01:21 -05:00
Noah
5ae1fca0ec Improve UX on windows
Use the `dirs` crate to find the config dir on non-unix; fix warnings
2019-09-04 11:15:41 -05:00
Aviv Palivoda
3d61129cfd Delay from_list tuple create in import 2019-08-31 11:31:59 +03:00
coolreader18
0df3ed5260 Fix redox print_prompt 2019-08-26 21:23:35 -05:00
Noah
5da00de769 Make print_prompt() a fn 2019-08-26 13:24:23 -05:00
coolreader18
13d7d636b6 Process prompt correctly on redox 2019-08-25 23:27:47 -05:00
coolreader18
6faf2637b4 Move NSIG, reorganize prompt stuff 2019-08-25 12:50:05 -05:00
coolreader18
0d492e7875 Raise a KeyboardInterrupt on a SIGINT 2019-08-23 16:57:39 -05:00
Windel Bouwman
b6f522d917 Allow &str to be used a dictionary key. 2019-08-17 17:11:23 +02:00
Windel Bouwman
2b02371ba1 Merge pull request #1258 from RustPython/coolreader18/site
Add site module and run it on startup
2019-08-16 08:39:51 +02:00
coolreader18
d33d5ce5f6 Initialize attributes on new modules 2019-08-15 23:06:30 -05:00
coolreader18
a0146c5fa6 Add site module and run it on startup 2019-08-15 15:33:36 -05:00
Marcin Pajkowski
e65e9ff7c3 Make func_ref an &PyObjectRef 2019-08-15 13:45:47 +02:00
coolreader18
4f9a71ff89 Change compile::compile() to take a Mode instead of an &Mode 2019-08-13 12:34:39 -05:00
coolreader18
dfcd679cc4 Initialize the main module properly 2019-08-09 17:35:14 -05:00
coolreader18
a982d850f7 Don't put '-' in usage string 2019-08-09 02:29:32 -05:00
coolreader18
e38e2c82b1 Use runpy to run modules with -m 2019-08-09 02:29:10 -05:00
coolreader18
076b975eb1 Make argument parsing fully match CPython's 2019-08-08 17:41:40 -05:00
coolreader18
a4ffc797bb Fix clap command line parsing of pyargs 2019-08-08 17:41:39 -05:00
Aviv Palivoda
db8de563ba Add dont_write_bytecode flag 2019-07-24 20:28:24 +03:00
Windel Bouwman
f7320cf545 Move Scope struct to its own file, making the frame module private in the process. 2019-07-23 20:39:47 +02:00
Windel Bouwman
e922a6a952 Fix trailing newline issue #17 2019-07-21 14:00:55 +02:00
Windel Bouwman
cdfcf5278c Use env::var where applicable. Fix flame-it feature build. 2019-07-14 21:39:26 +02:00
Windel Bouwman
49afefd4f2 Implement ideas from clippy. 2019-07-14 10:44:33 +02:00
Windel Bouwman
ee8bcf4921 Move processing of PYTHONPATH out of vm. 2019-07-14 09:59:27 +02:00
coolreader18
d9d7a91157 Move vm initialization to own function 2019-07-13 16:15:45 -05:00
coolreader18
402eb8a48b Merge branch 'master' into redox 2019-07-13 11:46:43 -05:00
coolreader18
e20adb3f14 Use BUILDTIME_RUSTPYTHONPATH env variable 2019-07-13 10:14:10 -05:00
Windel Bouwman
ac765a957b Add a settings struct for storage of different settings which influence the VM. 2019-07-13 12:23:53 +02:00
coolreader18
86a6b2a366 Use feature for proc_macro_hack 2019-07-13 00:59:18 -05:00
coolreader18
bd749eae2d Use more platform checks 2019-07-12 20:18:54 -05:00
coolreader18
1b0d288242 Insert path into sys.path for redox 2019-07-12 17:50:55 -05:00