GithubHelp home page GithubHelp logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Hello, not sure if you all are familiar with contextual diffs. But I basically 
put a
check in CIDR. If it's a tuple, it's not a CIDR IP. Well it could be, but that 
would
be silly. Then I don't know why your end = start(1), start = start(0) didn't 
work,
but I just set it at the same time and commented out the previous code.

--- /usr/lib/python2.4/site-packages/iptools-0.2-py2.4.egg/iptools/__init__.py 
2010-01-02 17:19:59.000000000 -0600
+++ __init__.py 2010-01-02 17:22:40.000000000 -0600
@@ -153,6 +153,10 @@
     Returns:
         True if str is a valid CIDR address, False otherwise
     """
+    # Quick check: If it's a tuple, toodles.
+    if isinstance(s, tuple):
+        return False
+
     if _CIDR_RE.match(s):
         ip, mask = s.split('/')
         if validate_ip(ip):
@@ -378,10 +382,12 @@
             start, end = cidr2block(start)

         elif end is None:
+            # This should work but it didn't. So I just set them both, once.
             if isinstance(start, tuple):
+                start, end = start
                 # tuple range
-                end = start(1)
-                start = start(0)
+                #end = start(1)
+                #start = start(0)
             else:
                 # degenerate range
                 end = start

Original comment by [email protected] on 2 Jan 2010 at 11:28

from python-iptools.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Apparently I never tested the tuple constructor. :(

Fixed in r15.

Original comment by casadebender on 4 Jan 2010 at 3:52

  • Changed state: Fixed

from python-iptools.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.