Skip to content

Commit

Permalink
Use os.scandir since platform.scandir got removed
Browse files Browse the repository at this point in the history
  • Loading branch information
cafehaine committed Apr 12, 2021
1 parent 932e93d commit df9517f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions xontrib/xlsd.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ def stat():
return mod


@lazyobject
def platform():
import xonsh.platform
return xonsh.platform


@lazyobject
def RE_XONSH_COLOR():
import xonsh.color_tools
Expand Down Expand Up @@ -364,7 +358,7 @@ def _get_entries(path: str, show_hidden: bool) -> List[os.DirEntry]:
"""
entries = []
try:
with platform.scandir(path) as iterator:
with os.scandir(path) as iterator:
for entry in iterator:
# Skip entries that start with a '.'
if not show_hidden and entry.name.startswith('.'):
Expand Down

0 comments on commit df9517f

Please sign in to comment.