]> git.pld-linux.org Git - packages/python-pyflakes.git/blob - pyflakes-IOError.patch
8e39c0fce1b4544569c62f7a10c6b48593f882ed
[packages/python-pyflakes.git] / pyflakes-IOError.patch
1 --- pyflakes-0.2.1/bin/pyflakes.orig    2005-10-07 16:58:28.000000000 +0200
2 +++ pyflakes-0.2.1/bin/pyflakes 2005-11-18 16:23:52.000000000 +0100
3 @@ -10,7 +10,11 @@
4          tree = compiler.parse(codeString)
5      except (SyntaxError, IndentationError):
6          value = sys.exc_info()[1]
7 -        (lineno, offset, line) = value[1][1:]
8 +        try:
9 +            (lineno, offset, line) = value[1][1:]
10 +        except IndexError:
11 +            print >> sys.stderr, 'could not compile %r' % (filename,)
12 +            return
13          if line.endswith("\n"):
14              line = line[:-1]
15          print >> sys.stderr, 'could not compile %r:%d:' % (filename, lineno)
16 @@ -24,7 +28,8 @@
17  
18  
19  def checkPath(filename):
20 -    return check(file(filename).read(), filename)
21 +    if os.path.exists(filename):
22 +        return check(file(filename).read(), filename)
23  
24  args = sys.argv[1:]
25  if args:
This page took 0.039522 seconds and 2 git commands to generate.