Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix up code that was merged incorrectly

  • Loading branch information...
commit 53c7df85c7d76d353ec004aac47c2b8e9a68430b 1 parent bff0ccd
@ksperling ksperling authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 S3/S3.py
View
15 S3/S3.py
@@ -45,12 +45,6 @@ def mime_magic_file(file):
return magic_.file(file)
def mime_magic_buffer(buffer):
return magic_.buffer(buffer)
-except ImportError, e:
- if str(e).find("magic") >= 0:
- magic_message = "Module python-magic is not available."
- else:
- magic_message = "Module python-magic can't be used (%s)." % e.message
- magic_message += " Guessing MIME types based on file extensions."
def mime_magic(file):
type = mime_magic_file(file)
@@ -58,8 +52,13 @@ def mime_magic(file):
return (type, None)
else:
return (mime_magic_buffer(gzip.open(file).read(8192)), 'gzip')
-
-except ImportError:
+
+except ImportError, e:
+ if str(e).find("magic") >= 0:
+ magic_message = "Module python-magic is not available."
+ else:
+ magic_message = "Module python-magic can't be used (%s)." % e.message
+ magic_message += " Guessing MIME types based on file extensions."
magic_warned = False
def mime_magic(file):
global magic_warned
Please sign in to comment.
Something went wrong with that request. Please try again.