Try initializing the variable first by using:
reddit = None
it could also be an issue with the library you are using causing the variable to not be initialized correctly, so also try renaming the variable to apistuff
or something like that.
(Also, you just leaked api keys, remove that ASAP.)