Noa
f9d9a1e15e
Implement weakref._remove_dead_weakref
2021-11-15 16:08:47 -06:00
Noa
ec0a658d20
Implement weakref.getweakrefs
2021-11-15 16:08:47 -06:00
Noa
c6871166d1
Make WeakListInner a sidetable
2021-11-15 16:08:47 -06:00
Noa
0b7c0fab61
Add miri test for dropping objects
2021-11-15 16:08:47 -06:00
Noa
86edc72c7e
Fix miri UB
2021-11-15 16:08:46 -06:00
Noa
65cde9a0d6
Optimize size of WeakRefList
...
The outer struct is only 1 word now, and inside the box it's a byte for
the mutex (which gets padded to a word) + a word for the linked list (we
don't use the tail) + a word for the pointer to the object.
2021-11-15 16:08:46 -06:00
Noa
e51cb82ff0
Unskip tests
2021-11-15 16:08:46 -06:00
Noa
baf581c11b
Update weakref.py and _weakrefset.py to Python 3.9
2021-11-15 16:08:46 -06:00
Noa
e42a3ca48e
Big overhaul part 1 - replace PyRc with manual RefCount + WeakRefList
2021-11-15 16:08:45 -06:00
Jeong YunWon
9fa5c5ac66
Merge pull request #3433 from deantvv/test-update
...
Update test for `support/os_helper.py`
2021-11-16 02:47:22 +09:00
Jeong YunWon
e7fa32c687
Merge pull request #3402 from Snowapril/refactor_exceptions
...
Refactor duplicated codes in exception creations
2021-11-16 02:45:30 +09:00
Jeong YunWon
15d8eec001
Merge pull request #3439 from youknowone/relocate-sys-test
...
relocate wrongly placed sys test in snippets/stdlib_os.py
2021-11-16 02:43:28 +09:00
Jeong Yunwon
93a7d59bbb
relocate wrongly placed sys test in snippets/stdlib_os.py
2021-11-16 01:23:53 +09:00
Dean Li
a1202f5602
test: update importlib
2021-11-13 14:21:59 +08:00
Steve Shi
742ea0c4fa
Reimpl Buffer Protocol and memoryview support ndarray with shape, stride and suboffset ( #3340 )
...
* Fix buffer protocol and memoryview
* Fix io and array the right way to use buffer protocol
* fix rebase
* fix memoryview and introduce VecBuffer
* fix deadlock
* fix memoryview avoid double release buffer
* impl ndim buffer support
* first implement nd array for buffer and memoryview
* fix slice adjust_indices
* fix adjust_indices introduct SaturatedSliceIterator
* fix memoryview cmp
* fix adjust_indices positive_order
* fix bug mark passed test
* fix clippy
* fix set_item_slice deadlock, optimize buffer
* Delete @test_113974_tmp
* Remove vec_buffer_type
* rusty names
* impl memoryview multi index
* add comments
Co-authored-by: Jeong YunWon <jeong@youknowone.org >
2021-11-13 07:17:11 +02:00
Dean Li
c15971f18a
test: update test_unicode_file
2021-11-13 04:24:06 +00:00
Dean Li
323cf44788
test: update test_urllib
2021-11-13 03:51:06 +00:00
Dean Li
2f7e695c4a
test: update test_uu
2021-11-13 03:44:54 +00:00
Dean Li
bd14debebe
test: update test_support
2021-11-13 03:36:25 +00:00
Dean Li
49a5805d11
test: use os_helper
2021-11-13 02:18:33 +00:00
Dean Li
ce75d5c6a2
test: os use os_helper
2021-11-13 02:18:33 +00:00
Dean Li
4bcf317fba
test: move os_helper out as py3.10
2021-11-13 02:18:33 +00:00
snowapril
97f3434c0a
Add AttrItemMeta for handling attribute item attathced with once
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
ab1693e131
Replace new_class to new_exception_type
...
Replace `new_class` method call for module-level exceptions to newly
added `new_exception_type`
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
59582ed295
Add new_exception_type for module-level exception
...
At previous, `vm.ctx.new_class` did role for adding exception in
module-level.
This commit add `new_exception_type` for doing that part of role.
As cpython implementation, if no bases is given, pass `exception_type`
by default
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
fee42a1074
Add docs for each error in ssl module
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
5e8d3bcacb
Remove duplicated static_cell! stmts in each modules
...
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
snowapril
733d544802
Wrap ItemFn and #[pyattr] with static_cell!
...
When we have to add #[pyattr] with function, that function must be
called only once when module is imported.
In previous, we did it with add static_cell for each function or skip
it(undesired).
I thought these static_cell stmt for all of each function in modules are
quite duplicated.
Thus, I add wrapping code when the given item is `ItemFn` and have `#[pyattr]`.
Signed-off-by: snowapril <sinjihng@gmail.com >
2021-11-12 21:40:26 +09:00
joohongpark
5ceb2be86e
fixed set.{__ror__, __sub__} operator to behave according to type
2021-11-11 16:11:48 +09:00
Noa
96a9d55a62
Merge pull request #3399 from RustPython/custom-signals
...
Allow sending custom signals to a vm
2021-11-10 14:25:06 -06:00
Jeong YunWon
31f619510f
Merge pull request #3425 from deantvv/os-getrandom
...
os: implement getrandom
2021-11-10 00:52:29 +09:00
Dean Li
b6f266d3b8
os: implement getrandom
2021-11-09 11:33:51 +00:00
Jeong YunWon
1681eb8c01
Merge pull request #3432 from DimitrisJim/enable_settime_macos
...
Enable `clock_settime` for macOS.
2021-11-09 17:34:11 +09:00
jfh
f4030ab1f6
Enable settime for macos.
2021-11-08 18:28:02 +02:00
Jeong YunWon
fddd072706
Merge pull request #3431 from DimitrisJim/freebsd_check
...
Add a check for freeBSD.
2021-11-09 01:09:55 +09:00
jfh
2de853435b
Add a check for freeBSD.
2021-11-08 17:08:43 +02:00
Jim Fasarakis-Hilliard
310578c422
Merge pull request #3426 from devnexen/netbsd_obsd_build_fix
...
netbsd/openbsd build fix
2021-11-07 15:46:23 +02:00
David Carlier
d6e89301a5
netbsd/openbsd build fix
2021-11-07 12:48:34 +00:00
Jeong YunWon
b80cec7798
Merge pull request #3423 from deantvv/os-waitstatus-to-exitcode
...
os: implement `os.waitstatus_to_exitcode`
2021-11-07 00:00:28 +09:00
Jeong YunWon
820a67cb7e
Merge pull request #3417 from moreal/as-mapping-str
...
Implement `AsMapping` for `PyStr`
2021-11-06 22:36:02 +09:00
Jim Fasarakis-Hilliard
7f1c5ec888
Merge pull request #3422 from devnexen/fbsd_build_fix
...
fix freebsd build wrong imports
2021-11-06 15:10:17 +02:00
Dean Li
bfe10aa448
test: update test_posix.py
2021-11-06 21:04:14 +08:00
Dean Li
de4c0363bd
test: update support.wait_process from py3.10
2021-11-06 21:04:13 +08:00
Dean Li
a762ce5426
os: implement waitstatus_to_exitcode
2021-11-06 21:04:13 +08:00
David Carlier
cf7b6eeec1
fix freebsd build wrong imports
2021-11-06 11:24:00 +00:00
Jim Fasarakis-Hilliard
625886f339
Merge pull request #3420 from zetwhite/pos_only_arg
...
fix error message for checking number of positional arguments
2021-11-06 12:10:57 +02:00
Jeong YunWon
d7f2e2e696
Merge pull request #3416 from deantvv/os-posix-spawn
...
os: fix posix_spawn exception
2021-11-06 18:53:29 +09:00
Jeong YunWon
98e3d26906
Use PyPathLike::into_cstring
2021-11-06 17:17:00 +09:00
zetwhite
0523a57195
fix error message for checking number of positional arguments
2021-11-06 17:00:20 +09:00
Moreal
276608233e
Implement AsMapping for PyStr
2021-11-06 15:46:41 +09:00