From 5de5ce47ec491aaa0c8ec9b2faae62195bc29ee6 Mon Sep 17 00:00:00 2001 From: Noa <33094578+coolreader18@users.noreply.github.com> Date: Mon, 27 Sep 2021 16:15:28 -0500 Subject: [PATCH] Make tokenize work on wasm --- Lib/tokenize.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/tokenize.py b/Lib/tokenize.py index 1aee21b5e1..215d032f45 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -24,7 +24,10 @@ __author__ = 'Ka-Ping Yee ' __credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, ' 'Skip Montanaro, Raymond Hettinger, Trent Nelson, ' 'Michael Foord') -from builtins import open as _builtin_open +try: + from builtins import open as _builtin_open +except ImportError: + pass from codecs import lookup, BOM_UTF8 import collections from io import TextIOWrapper