vsergeev / python-periphery

A pure Python 2/3 library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux.
MIT License
519 stars 139 forks source link

Unexport GPIO only if it has been exported before #39

Closed webmeister closed 4 years ago

webmeister commented 4 years ago

During open, the current implementation tries to export the GPIO if it is not already available, but then unconditionally unexports the GPIO again during close. This causes issues if exporting and unexporting is controlled by some external mechanism. This was no problem in v1.x, since the unexport code was only added later.