Skip to content

fix dump_module() bugs and rename parameter 'main' to 'module'#526

Merged
mmckerns merged 4 commits intouqfoundation:masterfrom
leogama:fix-525
Jul 15, 2022
Merged

fix dump_module() bugs and rename parameter 'main' to 'module'#526
mmckerns merged 4 commits intouqfoundation:masterfrom
leogama:fix-525

Conversation

@leogama
Copy link
Contributor

@leogama leogama commented Jul 13, 2022

Fixes #525

New phrasing of mismatching modules error messages in load_session():

>>> import dill
>>> dill.dump_module()
>>> dill.load_module(module='math')
ValueError: can't update module 'math' with the saved state of module '__main__'

>>> import types
>>> main = types.ModuleType('__main__')
>>> dill.load_module(module=main)
ValueError: can't update module-type object '__main__' with the saved state of imported module '__main__'

>>> dill.dump_module(module=main)
>>> dill.load_module(module='__main__')
ValueError: can't update imported module '__main__' with the saved state of module-type object '__main__'

leogama added 2 commits July 13, 2022 13:28
…qfoundation#525)

New phrasing of mismatching modules error messages in load_session():

```python
>>> import dill
>>> dill.dump_module()
>>> dill.load_module(module='math')
ValueError: can't update module 'math' with the saved state of module '__main__'

>>> import types
>>> main = types.ModuleType('__main__')
>>> dill.load_module(module=main)
ValueError: can't update module-type object '__main__' with the saved state of imported module '__main__'

>>> dill.dump_module(module=main)
>>> dill.load_module(module='__main__')
ValueError: can't update imported module '__main__' with the saved state of module-type object '__main__'
```
@mmckerns mmckerns added this to the dill-0.3.6 milestone Jul 13, 2022
@leogama
Copy link
Contributor Author

leogama commented Jul 14, 2022

@mmckerns Job finished here.

@mmckerns mmckerns self-requested a review July 15, 2022 10:37
Copy link
Member

@mmckerns mmckerns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. There are a very few doc updates that I'll make post-merge.

@mmckerns mmckerns merged commit 6b90f52 into uqfoundation:master Jul 15, 2022
@leogama leogama deleted the fix-525 branch July 15, 2022 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

some errors with dump_module and load_module

2 participants