From 59f3ec943d35d6ca773e725f0827da183d59af0f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 23 Jun 2018 18:30:21 -0700 Subject: [PATCH] database.py: FileNotFoundError is py3-only, cope --- src/wormhole_mailbox_server/database.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wormhole_mailbox_server/database.py b/src/wormhole_mailbox_server/database.py index fa99b75..a4dc267 100644 --- a/src/wormhole_mailbox_server/database.py +++ b/src/wormhole_mailbox_server/database.py @@ -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" %