Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added minor splitting optimization in django.utils.ipv6._unpack_ipv4

  • Loading branch information...
commit 127d9b2792131995caf87c16b73dbd61f360de2a 1 parent fffb558
Danilo Bargen dbrgn authored timgraham committed
Showing with 1 addition and 2 deletions.
  1. +1 −2  django/utils/ipv6.py
3  django/utils/ipv6.py
View
@@ -138,8 +138,7 @@ def _unpack_ipv4(ip_str):
if not ip_str.lower().startswith('0000:0000:0000:0000:0000:ffff:'):
return None
- hextets = ip_str.split(':')
- return hextets[-1]
+ return ip_str.rsplit(':', 1)[1]
def is_valid_ipv6_address(ip_str):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.