Skip to content

Commit

Permalink
Fix type annotations and unused imports in fs.tarfs
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Sep 19, 2020
1 parent 7ac51fb commit a49deed
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/tarfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
from __future__ import print_function
from __future__ import unicode_literals

import operator
import os
import tarfile
import typing
from collections import OrderedDict
from typing import cast, IO

import six
from six.moves import map
Expand Down Expand Up @@ -309,7 +307,7 @@ def _directory_entries(self):

# add all implicit dirnames if not in the cache already
for partial_name in map(relpath, recursepath(_name)):
dirinfo = tarfile.TarInfo(self._encode(partial_name))
dirinfo = tarfile.TarInfo(_encode(partial_name))
dirinfo.type = tarfile.DIRTYPE
_cache.setdefault(partial_name, dirinfo)

Expand Down Expand Up @@ -391,7 +389,6 @@ def getinfo(self, path, namespaces=None):
raw_info["details"] = {"type": int(ResourceType.directory)}

else:

_realpath = self._resolve(_path)
if _realpath is None:
raise errors.ResourceNotFound(path)
Expand All @@ -406,10 +403,10 @@ def getinfo(self, path, namespaces=None):

if "link" in namespaces:
if member.issym():
target = join(
target = normpath(join(
dirname(self._decode(member.name)),
self._decode(member.linkname),
)
)) # type: Option[Text]
else:
target = None
raw_info["link"] = {"target": target}
Expand Down

0 comments on commit a49deed

Please sign in to comment.