Commit Graph

2137 Commits

Author SHA1 Message Date
Windel Bouwman
3f343aff6c Merge pull request #1018 from palaviv/imp3
Importlib
2019-06-12 16:21:26 +02:00
coolreader18
cb2fe657a9 Merge pull request #1014 from mkurnikov/cleanup-get-method-error-handling
Cleanup get_method() error handling
2019-06-11 17:43:58 -05:00
Aviv Palivoda
1de9f73bd0 Optimize already loaded modules 2019-06-11 22:54:54 +03:00
Aviv Palivoda
ea8e28026b Simplify objmodule 2019-06-11 13:13:32 +03:00
Aviv Palivoda
603ef1ad05 Support from_list 2019-06-10 21:45:05 +03:00
Aviv Palivoda
e1472f2277 Add sys.dont_write_bytecode 2019-06-10 19:18:32 +03:00
Aviv Palivoda
03735a6d26 Add optional parameters to compile 2019-06-10 19:18:32 +03:00
Aviv Palivoda
8dec522f96 compile source may be bytes 2019-06-10 19:18:32 +03:00
Aviv Palivoda
10828e01fb Set sys.pycache_prefix to None 2019-06-10 19:18:32 +03:00
Aviv Palivoda
b567464378 Add ModuleNotFoundError to builtins 2019-06-10 19:18:32 +03:00
Aviv Palivoda
d9d0ea1834 Fix os to _os in class 2019-06-10 19:18:32 +03:00
Aviv Palivoda
5584733cda Add sys.path_importer_cache 2019-06-10 19:18:32 +03:00
Aviv Palivoda
c8248c3211 Expose __name__ in __dict__ 2019-06-10 19:18:32 +03:00
Aviv Palivoda
375790e142 objmodule should have a dict 2019-06-10 19:18:32 +03:00
Aviv Palivoda
fe0284aa05 Add new to objmodule and change __name__ to property 2019-06-10 19:18:32 +03:00
Aviv Palivoda
6615e811c0 Collapse concat 2019-06-10 19:18:32 +03:00
Aviv Palivoda
5c53e58547 Print frozen import file name in stacktrace 2019-06-10 19:18:32 +03:00
Aviv Palivoda
0e76dbb749 Add needed methods to _thread 2019-06-10 19:18:32 +03:00
Aviv Palivoda
2817214c88 Remove unused imports 2019-06-10 19:18:32 +03:00
Aviv Palivoda
7f61125866 Use _bootstrap.py __import__ 2019-06-10 19:18:32 +03:00
Aviv Palivoda
58d9d9deeb Add sys.path_hooks 2019-06-10 19:18:32 +03:00
Aviv Palivoda
a57f38b07f Rename builtin io to _io 2019-06-10 19:18:32 +03:00
Aviv Palivoda
fbaff7fd50 Install external importers on init_importlib 2019-06-10 19:18:32 +03:00
Aviv Palivoda
37b40c55da Add frozen _bootstrap_external.py 2019-06-10 19:18:32 +03:00
Aviv Palivoda
0d9a066712 Add sys.meta_path 2019-06-10 19:18:32 +03:00
Aviv Palivoda
f2145880fa Don't set __file__ for frozen modules 2019-06-10 19:18:32 +03:00
Aviv Palivoda
f1af6b1f40 Include _bootstrap.py as str 2019-06-10 19:18:32 +03:00
Aviv Palivoda
698044b128 Add Module.__name__ 2019-06-10 19:18:32 +03:00
Aviv Palivoda
e88d6ac1ef Add init_importlib 2019-06-10 19:18:32 +03:00
Aviv Palivoda
7ff59b27d7 Add _bootsrap.py as frozen module 2019-06-10 19:18:32 +03:00
coolreader18
740e8387b8 Merge pull request #1027 from alanjds/format-bang
Feature: str.format accepting !r, !s and !a
2019-06-10 10:56:00 -05:00
Alan Justino
854bacf452 Fix the Rust tests 2019-06-09 18:45:08 -03:00
Alan Justino
f0a2b4c50b Apply the {!r} on str.format calls
By the Python docs, the `!` forces a conversion of the argument before
applying the normal formating logic described after the `:` marker.

See: https://docs.python.org/3.4/library/string.html#format-string-syntax
2019-06-09 18:11:10 -03:00
Alan Justino
e19b674abf FormatSpec got a preconversor:FormatPreconversor to handle !r, !s and !a 2019-06-09 16:22:22 -03:00
coolreader18
68011df6cb Merge pull request #1024 from yanganto/str_isprintable
str.isprintable
2019-06-09 13:07:47 -05:00
Alan Justino
65d0093822 Dont fail on '{!r}'.format(...) 2019-06-09 13:46:13 -03:00
Antonio Yang
f76be43d26 str.isprintable
- check unicode type by unicode_categories
- rm redundant check of empty string
2019-06-09 23:33:38 +08:00
Windel Bouwman
eb234ca3c5 Merge pull request #1021 from mkurnikov/speed-up-file-open
Get io reader/writer classes only when needed
2019-06-08 16:13:42 +02:00
Windel Bouwman
a1e2da6807 Merge pull request #1020 from RustPython/coolreader18/no-pwd-android
Disable the pwd module on android
2019-06-08 16:12:23 +02:00
Maxim Kurnikov
baf62d56d2 get io reader/writer classes only when needed 2019-06-08 02:49:45 +03:00
coolreader18
2b555cb40e Merge pull request #1016 from mkurnikov/fix-io-open-r
Fix io.open("r") case and address some TODOs
2019-06-07 12:07:47 -05:00
coolreader18
50252b4e80 Disable the pwd module on android 2019-06-07 11:57:50 -05:00
Aviv Palivoda
8fccad1e09 Print warning to stderr
Co-Authored-By: coolreader18 <33094578+coolreader18@users.noreply.github.com>
2019-06-07 18:59:41 +03:00
Maxim Kurnikov
c0e1702869 split mode/type for io.open properly, fix open('r') case 2019-06-07 16:34:16 +03:00
Maxim Kurnikov
8a5182a8a1 make get_method_or_type_error() error message lazy 2019-06-07 16:08:37 +03:00
Aviv Palivoda
d2a82b1acd Add _warnings 2019-06-07 15:14:27 +03:00
Windel Bouwman
1b7088c353 Merge pull request #1017 from michelhe/memoryview_obj
Fix memoryview.obj misimplementation.
2019-06-05 13:22:49 +02:00
coolreader18
74d52ee82f Merge pull request #1011 from palaviv/_imp2
More _imp
2019-06-05 00:43:10 -05:00
Michel Heily
b2cdeab0c6 Fix memoryview.obj misimplementation.
The memoryview skeleton did not correctly assign the "obj" attribute;
The "obj" attribute was assigned to the memoryview class and not the memryview object,
leading to a funny bug that can be reproduced as follows:

```python

m1 = memoryview(b'1234')
m2 = memoryview(b'abcd')

print(m1.obj)
```

the result would be the value inside `m2` instead that of `m1`
2019-06-05 02:36:45 +03:00
Maxim Kurnikov
bc33921fdb make empty exception message format compatible with CPython 2019-06-04 14:59:28 +03:00