gpiod 2.2.0__tar.gz → 2.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {gpiod-2.2.0/gpiod.egg-info → gpiod-2.2.2}/PKG-INFO +1 -1
  2. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/chip.py +5 -4
  3. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/chip.c +28 -17
  4. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/common.c +9 -5
  5. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/internal.h +2 -1
  6. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/line-settings.c +4 -0
  7. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/request.c +19 -9
  8. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/line_settings.py +1 -1
  9. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/version.py +1 -1
  10. {gpiod-2.2.0 → gpiod-2.2.2/gpiod.egg-info}/PKG-INFO +1 -1
  11. {gpiod-2.2.0 → gpiod-2.2.2}/include/gpiod.h +8 -8
  12. {gpiod-2.2.0 → gpiod-2.2.2}/lib/chip-info.c +2 -2
  13. {gpiod-2.2.0 → gpiod-2.2.2}/lib/line-info.c +2 -2
  14. gpiod-2.2.2/libgpiod-version.txt +1 -0
  15. {gpiod-2.2.0 → gpiod-2.2.2}/setup.py +5 -1
  16. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_line_settings.py +1 -1
  17. gpiod-2.2.0/libgpiod-version.txt +0 -1
  18. {gpiod-2.2.0 → gpiod-2.2.2}/MANIFEST.in +0 -0
  19. {gpiod-2.2.0 → gpiod-2.2.2}/README.md +0 -0
  20. {gpiod-2.2.0 → gpiod-2.2.2}/build_tests.py +0 -0
  21. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/__init__.py +0 -0
  22. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/chip_info.py +0 -0
  23. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/edge_event.py +0 -0
  24. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/exception.py +0 -0
  25. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/line-config.c +0 -0
  26. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/ext/module.c +0 -0
  27. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/info_event.py +0 -0
  28. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/internal.py +0 -0
  29. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/line.py +0 -0
  30. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/line_info.py +0 -0
  31. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod/line_request.py +0 -0
  32. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod.egg-info/SOURCES.txt +0 -0
  33. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod.egg-info/dependency_links.txt +0 -0
  34. {gpiod-2.2.0 → gpiod-2.2.2}/gpiod.egg-info/top_level.txt +0 -0
  35. {gpiod-2.2.0 → gpiod-2.2.2}/lib/chip.c +0 -0
  36. {gpiod-2.2.0 → gpiod-2.2.2}/lib/edge-event.c +0 -0
  37. {gpiod-2.2.0 → gpiod-2.2.2}/lib/info-event.c +0 -0
  38. {gpiod-2.2.0 → gpiod-2.2.2}/lib/internal.c +0 -0
  39. {gpiod-2.2.0 → gpiod-2.2.2}/lib/internal.h +0 -0
  40. {gpiod-2.2.0 → gpiod-2.2.2}/lib/line-config.c +0 -0
  41. {gpiod-2.2.0 → gpiod-2.2.2}/lib/line-request.c +0 -0
  42. {gpiod-2.2.0 → gpiod-2.2.2}/lib/line-settings.c +0 -0
  43. {gpiod-2.2.0 → gpiod-2.2.2}/lib/misc.c +0 -0
  44. {gpiod-2.2.0 → gpiod-2.2.2}/lib/request-config.c +0 -0
  45. {gpiod-2.2.0 → gpiod-2.2.2}/lib/uapi/gpio.h +0 -0
  46. {gpiod-2.2.0 → gpiod-2.2.2}/pyproject.toml +0 -0
  47. {gpiod-2.2.0 → gpiod-2.2.2}/setup.cfg +0 -0
  48. {gpiod-2.2.0 → gpiod-2.2.2}/tests/__init__.py +0 -0
  49. {gpiod-2.2.0 → gpiod-2.2.2}/tests/__main__.py +0 -0
  50. {gpiod-2.2.0 → gpiod-2.2.2}/tests/gpiosim/__init__.py +0 -0
  51. {gpiod-2.2.0 → gpiod-2.2.2}/tests/gpiosim/chip.py +0 -0
  52. {gpiod-2.2.0 → gpiod-2.2.2}/tests/gpiosim/ext.c +0 -0
  53. {gpiod-2.2.0 → gpiod-2.2.2}/tests/helpers.py +0 -0
  54. {gpiod-2.2.0 → gpiod-2.2.2}/tests/procname/__init__.py +0 -0
  55. {gpiod-2.2.0 → gpiod-2.2.2}/tests/procname/ext.c +0 -0
  56. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_chip.py +0 -0
  57. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_chip_info.py +0 -0
  58. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_edge_event.py +0 -0
  59. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_info_event.py +0 -0
  60. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_line.py +0 -0
  61. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_line_info.py +0 -0
  62. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_line_request.py +0 -0
  63. {gpiod-2.2.0 → gpiod-2.2.2}/tests/tests_module.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gpiod
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Python bindings for libgpiod
5
5
  Home-page: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
6
6
  Author: Bartosz Golaszewski
@@ -226,7 +226,7 @@ class Chip:
226
226
  config: dict[tuple[Union[int, str]], Optional[LineSettings]],
227
227
  consumer: Optional[str] = None,
228
228
  event_buffer_size: Optional[int] = None,
229
- output_values: Optional[dict[tuple[Union[int, str]], Value]] = None,
229
+ output_values: Optional[dict[Union[int, str], Value]] = None,
230
230
  ) -> LineRequest:
231
231
  """
232
232
  Request a set of lines for exclusive usage.
@@ -279,11 +279,12 @@ class Chip:
279
279
  else:
280
280
  mapped_output_values = None
281
281
 
282
+ name_map = dict()
283
+ offset_map = dict()
284
+ global_output_values = list()
285
+
282
286
  for lines, settings in config.items():
283
287
  offsets = list()
284
- name_map = dict()
285
- offset_map = dict()
286
- global_output_values = list()
287
288
 
288
289
  if isinstance(lines, int) or isinstance(lines, str):
289
290
  lines = (lines,)
@@ -75,31 +75,34 @@ static PyObject *chip_get_info(chip_object *self, PyObject *Py_UNUSED(ignored))
75
75
  struct gpiod_chip_info *info;
76
76
  PyObject *type, *ret;
77
77
 
78
- type = Py_gpiod_GetGlobalType("ChipInfo");
78
+ type = Py_gpiod_GetModuleAttrString("gpiod.chip_info", "ChipInfo");
79
79
  if (!type)
80
80
  return NULL;
81
81
 
82
82
  info = gpiod_chip_get_info(self->chip);
83
- if (!info)
83
+ if (!info) {
84
+ Py_DECREF(type);
84
85
  return PyErr_SetFromErrno(PyExc_OSError);
86
+ }
85
87
 
86
- ret = PyObject_CallFunction(type, "ssI",
87
- gpiod_chip_info_get_name(info),
88
- gpiod_chip_info_get_label(info),
89
- gpiod_chip_info_get_num_lines(info));
90
- gpiod_chip_info_free(info);
91
- return ret;
88
+ ret = PyObject_CallFunction(type, "ssI",
89
+ gpiod_chip_info_get_name(info),
90
+ gpiod_chip_info_get_label(info),
91
+ gpiod_chip_info_get_num_lines(info));
92
+ gpiod_chip_info_free(info);
93
+ Py_DECREF(type);
94
+ return ret;
92
95
  }
93
96
 
94
97
  static PyObject *make_line_info(struct gpiod_line_info *info)
95
98
  {
96
- PyObject *type;
99
+ PyObject *type, *ret;
97
100
 
98
- type = Py_gpiod_GetGlobalType("LineInfo");
101
+ type = Py_gpiod_GetModuleAttrString("gpiod.line_info", "LineInfo");
99
102
  if (!type)
100
103
  return NULL;
101
104
 
102
- return PyObject_CallFunction(type, "IsOsiOiiiiOk",
105
+ ret = PyObject_CallFunction(type, "IsOsiOiiiiOk",
103
106
  gpiod_line_info_get_offset(info),
104
107
  gpiod_line_info_get_name(info),
105
108
  gpiod_line_info_is_used(info) ?
@@ -115,6 +118,8 @@ static PyObject *make_line_info(struct gpiod_line_info *info)
115
118
  gpiod_line_info_is_debounced(info) ?
116
119
  Py_True : Py_False,
117
120
  gpiod_line_info_get_debounce_period_us(info));
121
+ Py_DECREF(type);
122
+ return ret;
118
123
  }
119
124
 
120
125
  static PyObject *chip_get_line_info(chip_object *self, PyObject *args)
@@ -168,10 +173,6 @@ chip_read_info_event(chip_object *self, PyObject *Py_UNUSED(ignored))
168
173
  struct gpiod_info_event *event;
169
174
  struct gpiod_line_info *info;
170
175
 
171
- type = Py_gpiod_GetGlobalType("InfoEvent");
172
- if (!type)
173
- return NULL;
174
-
175
176
  Py_BEGIN_ALLOW_THREADS;
176
177
  event = gpiod_chip_read_info_event(self->chip);
177
178
  Py_END_ALLOW_THREADS;
@@ -186,11 +187,19 @@ chip_read_info_event(chip_object *self, PyObject *Py_UNUSED(ignored))
186
187
  return NULL;
187
188
  }
188
189
 
190
+ type = Py_gpiod_GetModuleAttrString("gpiod.info_event", "InfoEvent");
191
+ if (!type) {
192
+ Py_DECREF(info_obj);
193
+ gpiod_info_event_free(event);
194
+ return NULL;
195
+ }
196
+
189
197
  event_obj = PyObject_CallFunction(type, "iKO",
190
198
  gpiod_info_event_get_event_type(event),
191
199
  gpiod_info_event_get_timestamp_ns(event),
192
200
  info_obj);
193
201
  Py_DECREF(info_obj);
202
+ Py_DECREF(type);
194
203
  gpiod_info_event_free(event);
195
204
  return event_obj;
196
205
  }
@@ -274,14 +283,16 @@ static PyObject *chip_request_lines(chip_object *self, PyObject *args)
274
283
  Py_BEGIN_ALLOW_THREADS;
275
284
  request = gpiod_chip_request_lines(self->chip, req_cfg, line_cfg);
276
285
  Py_END_ALLOW_THREADS;
277
- gpiod_request_config_free(req_cfg);
278
- if (!request)
286
+ if (!request) {
287
+ gpiod_request_config_free(req_cfg);
279
288
  return Py_gpiod_SetErrFromErrno();
289
+ }
280
290
 
281
291
  req_obj = Py_gpiod_MakeRequestObject(request,
282
292
  gpiod_request_config_get_event_buffer_size(req_cfg));
283
293
  if (!req_obj)
284
294
  gpiod_line_request_release(request);
295
+ gpiod_request_config_free(req_cfg);
285
296
 
286
297
  return req_obj;
287
298
  }
@@ -64,15 +64,19 @@ PyObject *Py_gpiod_SetErrFromErrno(void)
64
64
  return PyErr_SetFromErrno(exc);
65
65
  }
66
66
 
67
- PyObject *Py_gpiod_GetGlobalType(const char *type_name)
67
+ PyObject *Py_gpiod_GetModuleAttrString(const char *modname,
68
+ const char *attrname)
68
69
  {
69
- PyObject *globals;
70
+ PyObject *module, *attribute;
70
71
 
71
- globals = PyEval_GetGlobals();
72
- if (!globals)
72
+ module = PyImport_ImportModule(modname);
73
+ if (!module)
73
74
  return NULL;
74
75
 
75
- return PyDict_GetItemString(globals, type_name);
76
+ attribute = PyObject_GetAttrString(module, attrname);
77
+ Py_DECREF(module);
78
+
79
+ return attribute;
76
80
  }
77
81
 
78
82
  unsigned int Py_gpiod_PyLongAsUnsignedInt(PyObject *pylong)
@@ -8,7 +8,8 @@
8
8
  #include <Python.h>
9
9
 
10
10
  PyObject *Py_gpiod_SetErrFromErrno(void);
11
- PyObject *Py_gpiod_GetGlobalType(const char *type_name);
11
+ PyObject *Py_gpiod_GetModuleAttrString(const char *modname,
12
+ const char *attrname);
12
13
  unsigned int Py_gpiod_PyLongAsUnsignedInt(PyObject *pylong);
13
14
  void Py_gpiod_dealloc(PyObject *self);
14
15
  PyObject *Py_gpiod_MakeRequestObject(struct gpiod_line_request *request,
@@ -79,6 +79,10 @@ line_settings_init(line_settings_object *self, PyObject *args, PyObject *kwargs)
79
79
  if (ret)
80
80
  return set_error();
81
81
 
82
+ ret = gpiod_line_settings_set_event_clock(self->settings, event_clock);
83
+ if (ret)
84
+ return set_error();
85
+
82
86
  return 0;
83
87
  }
84
88
 
@@ -149,10 +149,6 @@ static PyObject *request_get_values(request_object *self, PyObject *args)
149
149
  if (num_offsets < 0)
150
150
  return NULL;
151
151
 
152
- type = Py_gpiod_GetGlobalType("Value");
153
- if (!type)
154
- return NULL;
155
-
156
152
  iter = PyObject_GetIter(offsets);
157
153
  if (!iter)
158
154
  return NULL;
@@ -183,18 +179,26 @@ static PyObject *request_get_values(request_object *self, PyObject *args)
183
179
  if (ret)
184
180
  return Py_gpiod_SetErrFromErrno();
185
181
 
182
+ type = Py_gpiod_GetModuleAttrString("gpiod.line", "Value");
183
+ if (!type)
184
+ return NULL;
185
+
186
186
  for (pos = 0; pos < num_offsets; pos++) {
187
187
  val = PyObject_CallFunction(type, "i", self->values[pos]);
188
- if (!val)
188
+ if (!val) {
189
+ Py_DECREF(type);
189
190
  return NULL;
191
+ }
190
192
 
191
193
  ret = PyList_SetItem(values, pos, val);
192
194
  if (ret) {
193
195
  Py_DECREF(val);
196
+ Py_DECREF(type);
194
197
  return NULL;
195
198
  }
196
199
  }
197
200
 
201
+ Py_DECREF(type);
198
202
  Py_RETURN_NONE;
199
203
  }
200
204
 
@@ -279,10 +283,6 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
279
283
  max_events = 64;
280
284
  }
281
285
 
282
- type = Py_gpiod_GetGlobalType("EdgeEvent");
283
- if (!type)
284
- return NULL;
285
-
286
286
  Py_BEGIN_ALLOW_THREADS;
287
287
  ret = gpiod_line_request_read_edge_events(self->request,
288
288
  self->buffer, max_events);
@@ -296,10 +296,17 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
296
296
  if (!events)
297
297
  return NULL;
298
298
 
299
+ type = Py_gpiod_GetModuleAttrString("gpiod.edge_event", "EdgeEvent");
300
+ if (!type) {
301
+ Py_DECREF(events);
302
+ return NULL;
303
+ }
304
+
299
305
  for (i = 0; i < num_events; i++) {
300
306
  event = gpiod_edge_event_buffer_get_event(self->buffer, i);
301
307
  if (!event) {
302
308
  Py_DECREF(events);
309
+ Py_DECREF(type);
303
310
  return NULL;
304
311
  }
305
312
 
@@ -311,6 +318,7 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
311
318
  gpiod_edge_event_get_line_seqno(event));
312
319
  if (!event_obj) {
313
320
  Py_DECREF(events);
321
+ Py_DECREF(type);
314
322
  return NULL;
315
323
  }
316
324
 
@@ -318,10 +326,12 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
318
326
  if (ret) {
319
327
  Py_DECREF(event_obj);
320
328
  Py_DECREF(events);
329
+ Py_DECREF(type);
321
330
  return NULL;
322
331
  }
323
332
  }
324
333
 
334
+ Py_DECREF(type);
325
335
  return events;
326
336
  }
327
337
 
@@ -27,7 +27,7 @@ class LineSettings:
27
27
  # __repr__ generated by @dataclass uses repr for enum members resulting in
28
28
  # an unusable representation as those are of the form: <NAME: $value>
29
29
  def __repr__(self):
30
- return "gpiod.LineSettings(direction={}, edge_detection={}, bias={}, drive={}, active_low={}, debounce_period={}, event_clock={}, output_value={})".format(
30
+ return "gpiod.LineSettings(direction=gpiod.line.{}, edge_detection=gpiod.line.{}, bias=gpiod.line.{}, drive=gpiod.line.{}, active_low={}, debounce_period={}, event_clock=gpiod.line.{}, output_value=gpiod.line.{})".format(
31
31
  str(self.direction),
32
32
  str(self.edge_detection),
33
33
  str(self.bias),
@@ -2,4 +2,4 @@
2
2
  # SPDX-FileCopyrightText: 2022 Linaro Ltd.
3
3
  # SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4
4
 
5
- __version__ = "2.2.0"
5
+ __version__ = "2.2.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gpiod
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Python bindings for libgpiod
5
5
  Home-page: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
6
6
  Author: Bartosz Golaszewski
@@ -246,7 +246,7 @@ int gpiod_chip_get_fd(struct gpiod_chip *chip);
246
246
  * on the chip.
247
247
  * @param chip GPIO chip object.
248
248
  * @param timeout_ns Wait time limit in nanoseconds. If set to 0, the function
249
- * returns immediatelly. If set to a negative number, the
249
+ * returns immediately. If set to a negative number, the
250
250
  * function blocks indefinitely until an event becomes
251
251
  * available.
252
252
  * @return 0 if wait timed out, -1 if an error occurred, 1 if an event is
@@ -498,10 +498,10 @@ bool gpiod_line_info_is_used(struct gpiod_line_info *info);
498
498
  * @brief Get the name of the consumer of the line.
499
499
  * @param info GPIO line info object.
500
500
  * @return Name of the GPIO consumer as it is represented in the kernel.
501
- * This function returns a valid pointer to a null-terminated string
502
- * or NULL if the consumer name is not set.
503
- * The string lifetime is tied to the line info object so the pointer
504
- * must not be freed.
501
+ * This function returns a valid pointer to a null-terminated string
502
+ * or NULL if the consumer name is not set.
503
+ * The string lifetime is tied to the line info object so the pointer
504
+ * must not be freed.
505
505
  */
506
506
  const char *gpiod_line_info_get_consumer(struct gpiod_line_info *info);
507
507
 
@@ -509,7 +509,7 @@ const char *gpiod_line_info_get_consumer(struct gpiod_line_info *info);
509
509
  * @brief Get the direction setting of the line.
510
510
  * @param info GPIO line info object.
511
511
  * @return Returns ::GPIOD_LINE_DIRECTION_INPUT or
512
- * ::GPIOD_LINE_DIRECTION_OUTPUT.
512
+ * ::GPIOD_LINE_DIRECTION_OUTPUT.
513
513
  */
514
514
  enum gpiod_line_direction
515
515
  gpiod_line_info_get_direction(struct gpiod_line_info *info);
@@ -518,7 +518,7 @@ gpiod_line_info_get_direction(struct gpiod_line_info *info);
518
518
  * @brief Get the edge detection setting of the line.
519
519
  * @param info GPIO line info object.
520
520
  * @return Returns ::GPIOD_LINE_EDGE_NONE, ::GPIOD_LINE_EDGE_RISING,
521
- * ::GPIOD_LINE_EDGE_FALLING or ::GPIOD_LINE_EDGE_BOTH.
521
+ * ::GPIOD_LINE_EDGE_FALLING or ::GPIOD_LINE_EDGE_BOTH.
522
522
  */
523
523
  enum gpiod_line_edge
524
524
  gpiod_line_info_get_edge_detection(struct gpiod_line_info *info);
@@ -1164,7 +1164,7 @@ int gpiod_line_request_get_fd(struct gpiod_line_request *request);
1164
1164
  * @brief Wait for edge events on any of the requested lines.
1165
1165
  * @param request GPIO line request.
1166
1166
  * @param timeout_ns Wait time limit in nanoseconds. If set to 0, the function
1167
- * returns immediatelly. If set to a negative number, the
1167
+ * returns immediately. If set to a negative number, the
1168
1168
  * function blocks indefinitely until an event becomes
1169
1169
  * available.
1170
1170
  * @return 0 if wait timed out, -1 if an error occurred, 1 if an event is
@@ -10,8 +10,8 @@
10
10
 
11
11
  struct gpiod_chip_info {
12
12
  size_t num_lines;
13
- char name[32];
14
- char label[32];
13
+ char name[GPIO_MAX_NAME_SIZE + 1];
14
+ char label[GPIO_MAX_NAME_SIZE + 1];
15
15
  };
16
16
 
17
17
  GPIOD_API void gpiod_chip_info_free(struct gpiod_chip_info *info)
@@ -10,9 +10,9 @@
10
10
 
11
11
  struct gpiod_line_info {
12
12
  unsigned int offset;
13
- char name[GPIO_MAX_NAME_SIZE];
13
+ char name[GPIO_MAX_NAME_SIZE + 1];
14
14
  bool used;
15
- char consumer[GPIO_MAX_NAME_SIZE];
15
+ char consumer[GPIO_MAX_NAME_SIZE + 1];
16
16
  enum gpiod_line_direction direction;
17
17
  bool active_low;
18
18
  enum gpiod_line_bias bias;
@@ -0,0 +1 @@
1
+ 2.2
@@ -70,6 +70,7 @@ def fetch_tarball(command):
70
70
  def wrapper(self):
71
71
  # Just-in-time import of tarfile and urllib.request so these are
72
72
  # not required for Yocto to build a vendored or linked package
73
+ import sys
73
74
  import tarfile
74
75
  from tempfile import TemporaryDirectory
75
76
  from urllib.request import urlretrieve
@@ -122,7 +123,10 @@ def fetch_tarball(command):
122
123
  # Unpack the downloaded tarball
123
124
  log.info(f"unpacking: {tarball_filename}")
124
125
  with tarfile.open(downloaded_tarball) as f:
125
- f.extractall(temp_dir)
126
+ if sys.version_info < (3, 12):
127
+ f.extractall(temp_dir)
128
+ else:
129
+ f.extractall(temp_dir, filter=tarfile.fully_trusted_filter)
126
130
 
127
131
  # Copy the include and lib directories we need to build libgpiod
128
132
  base_dir = path.join(temp_dir, f"libgpiod-{LIBGPIOD_VERSION}")
@@ -69,7 +69,7 @@ class LineSettingsStringRepresentation(TestCase):
69
69
  def test_repr(self):
70
70
  self.assertEqual(
71
71
  repr(self.settings),
72
- "gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.OPEN_SOURCE, active_low=True, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE)",
72
+ "gpiod.LineSettings(direction=gpiod.line.Direction.OUTPUT, edge_detection=gpiod.line.Edge.NONE, bias=gpiod.line.Bias.AS_IS, drive=gpiod.line.Drive.OPEN_SOURCE, active_low=True, debounce_period=datetime.timedelta(0), event_clock=gpiod.line.Clock.MONOTONIC, output_value=gpiod.line.Value.INACTIVE)",
73
73
  )
74
74
 
75
75
  cmp = eval(repr(self.settings))
@@ -1 +0,0 @@
1
- 2.1.2
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes