Skip to content

Fix memoryview.obj misimplementation. #1017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2019

Conversation

michelhe
Copy link
Contributor

@michelhe michelhe commented Jun 4, 2019

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:

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

print(m1.obj)

the result would be the value inside m2 instead that of m1

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`
@codecov-io
Copy link

Codecov Report

Merging #1017 into master will decrease coverage by <.01%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1017      +/-   ##
==========================================
- Coverage   64.58%   64.57%   -0.01%     
==========================================
  Files          96       96              
  Lines       16891    16894       +3     
  Branches     3775     3774       -1     
==========================================
+ Hits        10909    10910       +1     
- Misses       3426     3429       +3     
+ Partials     2556     2555       -1
Impacted Files Coverage Δ
vm/src/obj/objmemory.rs 75% <75%> (-7.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c9d3c8...b2cdeab. Read the comment docs.

@windelbouwman
Copy link
Contributor

Thanks for contributing! This change looks good!

@windelbouwman windelbouwman merged commit 1b7088c into RustPython:master Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants