Skip to content

[BUG] Global variables not set correctly on Python 3.11 #15

@quellus

Description

@quellus

Describe the bug
Variables such as setModeDone and _mode aren't set correctly.

I believe this is only an issue specifically with the setmode() function. After calling setmode(), the results of getmode() and setModeDone remain unchanged.

To Reproduce
Steps to reproduce the behavior:

  1. call setmode()
  2. call getmode() and view the return value
  3. return value remains 0 regardless of what you set the mode to
  4. view the contents of setModeDone
  5. setModeDone is False despite that you just set mode

Expected behavior
After calling, for example, setmode(GPIO.BCM),
getmode() should return 11
setModeDone should contain True

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] N/A
  • Version [e.g. 22] 0.1.10
  • Python Version 3.11.9

Additional context
The solution should really just be a 2 line change. At the top of the setmode function, add:

global setModeDone
global _mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions