diff --git a/lib/ansible/modules/extras/cloud/amazon/s3_bucket.py b/lib/ansible/modules/extras/cloud/amazon/s3_bucket.py
index e41a50ccba..6e5466c1f6 100644
--- a/lib/ansible/modules/extras/cloud/amazon/s3_bucket.py
+++ b/lib/ansible/modules/extras/cloud/amazon/s3_bucket.py
@@ -113,6 +113,9 @@ EXAMPLES = '''
 import xml.etree.ElementTree as ET
 import urlparse
 
+from ansible.module_utils.basic import *
+from ansible.module_utils.ec2 import *
+
 try:
     import boto.ec2
     from boto.s3.connection import OrdinaryCallingFormat, Location
@@ -445,9 +448,5 @@ def main():
     elif state == 'absent':
         destroy_bucket(connection, module, flavour=flavour)
 
-from ansible.module_utils.basic import *
-from ansible.module_utils.ec2 import *
-import urlparse
-
 if __name__ == '__main__':
     main()