Commit 2c4506a2 authored by Jim Fulton's avatar Jim Fulton

Removed a print statement. Getting class meta data from a pickle

can fail if the pickle has been transformed and a calling storage
doesn't account for that.  Printing is certainly not the right way to
deal with the problem.

Also cleaned up some whitespace.
parent 2509cc6d
...@@ -87,10 +87,10 @@ U64 = u64 ...@@ -87,10 +87,10 @@ U64 = u64
def cp(f1, f2, length=None): def cp(f1, f2, length=None):
"""Copy all data from one file to another. """Copy all data from one file to another.
It copies the data from the current position of the input file (f1) It copies the data from the current position of the input file (f1)
appending it to the current position of the output file (f2). appending it to the current position of the output file (f2).
It copies at most 'length' bytes. If 'length' isn't given, it copies It copies at most 'length' bytes. If 'length' isn't given, it copies
until the end of the input file. until the end of the input file.
""" """
...@@ -103,7 +103,7 @@ def cp(f1, f2, length=None): ...@@ -103,7 +103,7 @@ def cp(f1, f2, length=None):
f1.seek(0,2) f1.seek(0,2)
length = f1.tell() length = f1.tell()
f1.seek(old_pos) f1.seek(old_pos)
while length > 0: while length > 0:
if n > length: if n > length:
n = length n = length
...@@ -206,7 +206,6 @@ def get_pickle_metadata(data): ...@@ -206,7 +206,6 @@ def get_pickle_metadata(data):
try: try:
class_info = u.load() class_info = u.load()
except Exception, err: except Exception, err:
print "Error", err
return '', '' return '', ''
if isinstance(class_info, tuple): if isinstance(class_info, tuple):
if isinstance(class_info[0], tuple): if isinstance(class_info[0], tuple):
...@@ -251,7 +250,7 @@ class Locked(object): ...@@ -251,7 +250,7 @@ class Locked(object):
raise AssertionError( raise AssertionError(
"Failed precondition: ", "Failed precondition: ",
precondition.__doc__.strip()) precondition.__doc__.strip())
return func(*args, **kw) return func(*args, **kw)
finally: finally:
inst._lock_release() inst._lock_release()
...@@ -269,4 +268,4 @@ class locked(object): ...@@ -269,4 +268,4 @@ class locked(object):
def __call__(self, func): def __call__(self, func):
return Locked(func, preconditions=self.preconditions) return Locked(func, preconditions=self.preconditions)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment