Merge github.com:web2py/web2py

This commit is contained in:
Michele Comitini
2012-10-28 14:38:03 +01:00
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.2.1 (2012-10-26 15:51:12) stable Version 2.2.1 (2012-10-27 14:37:32) stable
+3 -4
View File
@@ -9,7 +9,6 @@ License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This file specifically includes utilities for security. This file specifically includes utilities for security.
""" """
import string
import threading import threading
import struct import struct
import hashlib import hashlib
@@ -38,7 +37,7 @@ try:
except ImportError: except ImportError:
try: try:
from .aes import AES from .aes import AES
except (ImportError, ValueError): except ImportError:
from contrib.aes import AES from contrib.aes import AES
try: try:
@@ -271,7 +270,7 @@ def is_valid_ip_address(address):
address = address[7:] address = address[7:]
if hasattr(socket, 'inet_aton'): # try validate using the OS if hasattr(socket, 'inet_aton'): # try validate using the OS
try: try:
addr = socket.inet_aton(address) socket.inet_aton(address)
return True return True
except socket.error: # invalid address except socket.error: # invalid address
return False return False
@@ -282,7 +281,7 @@ def is_valid_ip_address(address):
return False return False
elif hasattr(socket, 'inet_pton'): # assume IPv6, try using the OS elif hasattr(socket, 'inet_pton'): # assume IPv6, try using the OS
try: try:
addr = socket.inet_pton(socket.AF_INET6, address) socket.inet_pton(socket.AF_INET6, address)
return True return True
except socket.error: # invalid address except socket.error: # invalid address
return False return False