Skip to content

Commit

Permalink
database.py: FileNotFoundError is py3-only, cope
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Jun 24, 2018
1 parent f8e3112 commit 59f3ec9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wormhole_mailbox_server/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def get_schema(name, version):
return schema_bytes.decode("utf-8")

def get_upgrader(name, new_version):
try:
FileNotFoundError # py3
except NameError:
FileNotFoundError = EnvironmentError # py2
try:
schema_bytes = resource_string("wormhole_mailbox_server",
"db-schemas/upgrade-%s-to-v%d.sql" %
Expand Down

0 comments on commit 59f3ec9

Please sign in to comment.