regro / rever

Releaser of Versions
https://regro.github.io/rever-docs/
BSD 3-Clause "New" or "Revised" License
75 stars 34 forks source link

Fix UnboundLocalError #256

Closed takluyver closed 2 years ago

takluyver commented 2 years ago

If github3.py can't be imported, this code was failing with:

Traceback (most recent call last):
  File "/home/takluyver/.local/lib/python3.10/site-packages/rever/activity.xsh", line 83, in __call__
    self.func(*args, **kwargs)
  File "/home/takluyver/.local/lib/python3.10/site-packages/rever/activities/ghrelease.xsh", line 101, in _func
    gh = github.login()
  File "/home/takluyver/.local/lib/python3.10/site-packages/rever/github.xsh", line 288, in login
    github3.login(username, token=token)
  File "/home/takluyver/.local/lib/python3.10/site-packages/lazyasd.py", line 64, in __getattribute__
    obj = self._lazy_obj()
  File "/home/takluyver/.local/lib/python3.10/site-packages/lazyasd.py", line 56, in _lazy_obj
    obj = d['load']()
  File "/home/takluyver/.local/lib/python3.10/site-packages/rever/github.xsh", line 51, in github3
    return GitHub()
UnboundLocalError: local variable 'GitHub' referenced before assignment

It looks like the local variable was previously called gh3.

saraedum commented 2 years ago

@takluyver could you add news/ for your change?

takluyver commented 2 years ago

Sure, how's that?