Skip to content

Commit

Permalink
python 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicferrier committed Nov 15, 2011
1 parent d50fd3e commit 6a890ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/pyproxyfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _mergedict(a, b):
Destructive on argument 'a'.
"""
for p, d1 in b.iteritems():
for p, d1 in b.items():
if p in a:
if not isinstance(d1, dict):
continue
Expand All @@ -72,7 +72,7 @@ def __init__(self, data):
# {"a": {"b": "filecontent"}}
self.files = {}
# Make the path: object into a nested dict setup
for name,data in data.iteritems():
for name,data in data.items():
paths = name.split("/")
if paths[0] == "":
paths = paths[1:]
Expand Down Expand Up @@ -138,7 +138,7 @@ def rename(self, old, new):
def remove(self, path):
"""Deletes just the end point"""
def _path_find(path_parts, fs):
for p,f in fs.iteritems():
for p,f in fs.items():
if p == path_parts[0]:
if len(path_parts) == 1:
del fs[p]
Expand Down Expand Up @@ -179,7 +179,7 @@ def _path(self, path):
Raises KeyError if the path is not found
"""
def _path_find(path_parts, fs):
for p,f in fs.iteritems():
for p,f in fs.items():
if p == path_parts[0]:
if len(path_parts) == 1:
return f
Expand Down
2 changes: 1 addition & 1 deletion src/pyproxyfs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_rename_across_dirs(self):
renametestfs.listdir("d1/s1") == ["bb"],
renametestfs.listdir("d1/s1")
)
print "\n", renametestfs.files
print("\n", renametestfs.files)

def test_open(self):
self.assert_(
Expand Down
2 changes: 1 addition & 1 deletion src/pyproxyfs/testit.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def testfs(*args):

if __name__ == "__main__":
import sys
print sys.path
print(sys.path)
import doctest
doctest.testmod()

Expand Down

0 comments on commit 6a890ff

Please sign in to comment.