Skip to content

Commit

Permalink
Fix __init__ to allow for proper package use (#491)
Browse files Browse the repository at this point in the history
Prior to this, __init__ running would merely create an empty module named `openlocationcode` with no attributes on Python 3.10 and 3.9. I haven't tested if this explicitly works on 3.8 and older, but it should.

Co-authored-by: Doug Rinckes <drinckes@google.com>
  • Loading branch information
NexusXe and drinckes authored Dec 6, 2024
1 parent 433c59f commit b693748
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/openlocationcode/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
from openlocationcode import *
if __name__ == "__main__":
from openlocationcode import *
else:
from .openlocationcode import *

0 comments on commit b693748

Please sign in to comment.