Skip to content

Commit

Permalink
Move import zlib to top level
Browse files Browse the repository at this point in the history
  • Loading branch information
ifduyue committed Aug 3, 2023
1 parent 170af4c commit a2b1dc5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions urlfetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
__url__ = "https://github.com/ifduyue/urlfetch"
__license__ = "BSD 2-Clause License"

import zlib
import os, sys, base64, codecs, uuid, stat, time, socket
import ssl
from os.path import basename, dirname, abspath, join as pathjoin
Expand Down Expand Up @@ -258,8 +259,6 @@ def __next__(self):
ce = self._content_encoding
if ce in ("gzip", "deflate"):
if not self._decoder:
import zlib

if ce == "gzip":
self._decoder = zlib.decompressobj(16 + zlib.MAX_WBITS)
else:
Expand Down

0 comments on commit a2b1dc5

Please sign in to comment.