Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
EntilZha committed Apr 22, 2020
1 parent 242bcc2 commit d3d5bb8
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions functional/io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import gzip
import lzma
import bz2
import io
import sys
import builtins


Expand Down Expand Up @@ -191,11 +192,6 @@ def __init__(
)

def __iter__(self):
if "__pypy__" in sys.builtin_module_names:
import bz2file as bz2 # pylint: disable=import-error
else:
import bz2

with bz2.open(
self.path,
mode=self.mode,
Expand All @@ -208,11 +204,6 @@ def __iter__(self):
yield line

def read(self):
if "__pypy__" in sys.builtin_module_names:
import bz2file as bz2 # pylint: disable=import-error
else:
import bz2

with bz2.open(
self.path,
mode=self.mode,
Expand Down Expand Up @@ -259,11 +250,6 @@ def __init__(
self.filters = filters

def __iter__(self):
try:
import lzma
except ImportError:
from backports import lzma

with lzma.open(
self.path,
mode=self.mode,
Expand All @@ -279,11 +265,6 @@ def __iter__(self):
yield line

def read(self):
try:
import lzma
except ImportError:
from backports import lzma

with lzma.open(
self.path,
mode=self.mode,
Expand Down Expand Up @@ -349,10 +330,6 @@ def universal_write_open(
encoding=encoding,
)
elif compression in ("lzma", "xz"):
try:
import lzma
except ImportError:
from backports import lzma
return lzma.open(
path,
mode=mode,
Expand All @@ -365,11 +342,6 @@ def universal_write_open(
newline=newline,
)
elif compression == "bz2":
if "__pypy__" in sys.builtin_module_names:
import bz2file as bz2 # pylint: disable=import-error
else:
import bz2

return bz2.open(
path,
mode=mode,
Expand Down

0 comments on commit d3d5bb8

Please sign in to comment.