Skip to content

Commit

Permalink
Fix mangled value for machine attribute in version function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Jul 2, 2018
1 parent 39c3e8e commit 2fdfb25
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,11 @@
Release History
===============

1.3.1
-----

* Fix bug in version parsing that was mangling the ``machine`` attribute.

1.3.0
-----

Expand Down
2 changes: 1 addition & 1 deletion microfs.py
Expand Up @@ -294,7 +294,7 @@ def version(serial=None):
# It doesn't matter what the error is, we just need to indicate a
# failure with the expected ValueError exception.
raise ValueError()
raw = out.decode('utf-8')
raw = out.decode('utf-8').strip()
raw = raw[1:-1]
items = raw.split(', ')
result = {}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -3,7 +3,7 @@


#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION
_VERSION = (1, 3, 0)
_VERSION = (1, 3, 1)


def get_version():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_microfs.py
Expand Up @@ -539,7 +539,7 @@ def test_version_good_output():
b'release=\'1.0\', '
b'version="micro:bit v1.0-b\'e10a5ff\' on 2018-6-8; '
b'MicroPython v1.9.2-34-gd64154c73 on 2017-09-01", '
b'machine=\'micro:bit with nRF51822\')')
b'machine=\'micro:bit with nRF51822\')\r\n')
mock_serial = mock.MagicMock()
with mock.patch('microfs.execute', return_value=(response,
b'')) as execute:
Expand Down

0 comments on commit 2fdfb25

Please sign in to comment.