[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:

The logic is currently duplicated because trying to import `shared_memory` is 
how support discovery is supposed to work in user code.

`multiprocessing.managers` doesn't export HAS_SHMEM (it's not in `__all__` and 
it's not documented). Making tests rely on it feels wrong to me. It might 
change in the future.

--
nosy: +lukasz.langa
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou
versions:  -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
pull_requests: +26883
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28487

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
components: +Tests
versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev


New submission from Nikita Sobolev :

`HAS_SHMEM` is defined in `multiprocessing.managers` module 
https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/multiprocessing/managers.py#L35-L40

Later the same logic is duplicated in `_test_multiprocessing`: 
https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/test/_test_multiprocessing.py#L52-L56

We can just use `multiprocessing.managers.HAS_SHMEM` instead.

I am going to send a PR with the fix.

--
messages: 402291
nosy: sobolevn
priority: normal
severity: normal
status: open
title: HAS_SHMEM detection logic is duplicated in implementation and tests
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com