Skip to content

Conversation

@missionfloyd
Copy link
Contributor

@missionfloyd missionfloyd commented Feb 8, 2025

Replaces this roundabout method...

if sys.version_info[0] == 2:
process = subprocess.Popen("cat /proc/cpuinfo | grep Raspberry", shell=True, stdout=subprocess.PIPE)
else:
process = subprocess.Popen("cat /proc/cpuinfo | grep Raspberry", shell=True, stdout=subprocess.PIPE, text=True)
output, _ = process.communicate()
if sys.version_info[0] == 2:
output = output.decode(sys.stdout.encoding)

...with a simple check for either /sys/bus/platform/drivers/gpiomem-bcm2835 or /sys/bus/platform/drivers/rpi-gpiomem, as in setup.py.

Similarly, in epdconfig for 13in3E, reads files directly, rather than capturing the output of cat.

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.

1 participant