Skip to content

Commit 8e0a8d7

Browse files
committed
* TL;DR: didn't RTFM
1 parent 28dfde7 commit 8e0a8d7

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
trio-gpio (0.2.3-2) unstable; urgency=medium
2+
3+
* TL;DR: didn't RTFM
4+
5+
-- Matthias Urlichs <[email protected]> Mon, 11 Jun 2018 09:08:30 +0200
6+
17
trio-gpio (0.2.2-1) unstable; urgency=medium
28

39
* Access errno

trio_gpio/gpio.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,10 @@ def _enter_io(self):
135135
)
136136
else:
137137
self.__exit__()
138-
raise RuntimeError("Unknown direction", r)
138+
raise RuntimeError("Unknown direction")
139139
if r != 0:
140-
if r < 0:
141-
r = gpio.ffi.errno
142140
self.__exit__()
143-
raise OSError("unable to set direction", r)
141+
raise OSError("unable to set direction")
144142
self._state = _IN_IO
145143
return self
146144

@@ -151,7 +149,7 @@ def _enter_ev(self):
151149
req.flags = self._flags
152150

153151
if gpio.lib.gpiod_line_request(self._line, req, 0) != 0:
154-
raise OSError("unable to request event monitoring", gpio.ffi.errno)
152+
raise OSError("unable to request event monitoring")
155153
self._state = _IN_EV
156154

157155
def __exit__(self, *tb):
@@ -279,9 +277,7 @@ async def __anext__(self):
279277
self._is_open()
280278
r = gpio.lib.gpiod_line_event_read_fd(fd, ev)
281279
if r != 0:
282-
if r < 0:
283-
r = gpio.ffi.errno
284-
raise OSError("unable to read update", r)
280+
raise OSError("unable to read update")
285281
return Event(ev)
286282

287283
async def aclose(self):

0 commit comments

Comments
 (0)