title: Github API: how to check if repository is empty?
body: <p>I'm using pygithub3 library to parse user repositories, but from time to time, it crasshes on assertion after failed request. At first I suspected that I have hit rate limit, but soon I realized that I can 100% reproduce assertion on 'empty' repository (see example).</p>
  
  <p><a href="https://github.com/poelzi/vaultfs" rel="nofollow">https://github.com/poelzi/vaultfs</a></p>
  
  <p>How would I go around checking if repository is available?
  Simplified code snippet:</p>
  
  <pre><code>for repo in gh.repos.list(user=author).all():
     ...
     contributors = repo.list_contributors(user=repo.owner.login, repo=repo.name).all()
  </code></pre>
  
  <p>It works for in 99% cases, but when I run into empty repositories, it crashes and I couldn't find any way to 'detect' it.</p>