Skip to content

Commit

Permalink
py2 windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Dec 6, 2016
1 parent eca7c4a commit e1bb392
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
7 changes: 0 additions & 7 deletions fs/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,6 @@ def _scandir(self, path, namespaces=None):
_path = abspath(normpath(path))
sys_path = self._to_sys_path(_path)
with convert_os_errors('scandir', path, directory=True):
try:
scan_iter = scandir(sys_path)
except OSError as error:
if error.errno == 267:
# Translate Windows 267 error
raise errors.DirectoryExpected(path)
raise
for dir_entry in scandir(sys_path):
info = {
"basic": {
Expand Down
21 changes: 13 additions & 8 deletions tests/test_ftpfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
from __future__ import print_function
from __future__ import unicode_literals

from six import text_type

from six.moves.urllib.request import urlopen

import ftplib
import os
import shutil
Expand All @@ -16,6 +12,9 @@
import unittest
import uuid

from six import text_type, PY2
from six.moves.urllib.request import urlopen

from ftplib import error_perm
from ftplib import error_temp

Expand Down Expand Up @@ -121,10 +120,16 @@ def make_fs(self):

os.mkdir(temp_path)
env = os.environ.copy()
env['PYTHONPATH'] = os.path.join(
os.getcwd(),
env.get('PYTHONPATH', '')
)
if PY2:
env['PYTHONPATH'] = os.path.join(
os.getcwd(),
env.get('PYTHONPATH', '')
)
else:
env[b'PYTHONPATH'] = os.path.join(
os.getcwd(),
env.get('PYTHONPATH', '')
).encode()
server = subprocess.Popen(
[
sys.executable,
Expand Down

0 comments on commit e1bb392

Please sign in to comment.