Apologies, I attached the reversed diff ... here is a correct diff -u
===========
---
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylint/epylint.py
2011-08-01 14:00:12.000000000 +1200
+++
/Volumes/MacData/Users/derek/py-virtualenv/production-2.7/lib/python2.7/site-packages/pylint/epylint.py
2011-12-30 16:15:52.000000000 +1300
@@ -57,11 +57,10 @@
childPath = os.path.join(os.path.basename(parentPath), childPath)
parentPath = os.path.dirname(parentPath)
- # Start pylint
- process = Popen('pylint-2.7 -f parseable -r n --disable=C,R,I "%s"' %
- childPath, shell=True, stdout=PIPE, stderr=PIPE,
- cwd=parentPath)
- p = process.stdout
+ # Ensure we use the python and pylint associated with the running epylint
+ lintPath = os.path.join(os.path.dirname(__file__), 'lint.py')
+ cmd = '%s %s -f parseable -r n --disable=C,R,I "%s"' % (sys.executable,
lintPath, childPath)
+ process = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, cwd=parentPath)
# The parseable line format is '%(path)s:%(line)s: [%(sigle)s%(obj)s]
%(msg)s'
# NOTE: This would be cleaner if we added an Emacs reporter to
pylint.reporters.text ..
@@ -76,7 +75,7 @@
# replace as "Warning (W0511, funcName): Warning Text"
return "%s (%s%s):" % (replacement, mObj.group("type"),
mObj.group("remainder"))
- for line in p:
+ for line in process.stdout:
# remove pylintrc warning
if line.startswith("No config file found"):
continue
@@ -87,7 +86,9 @@
line = ":".join([filename] + parts[1:])
print line,
- p.close()
+ # was there an error?
+ process.wait()
+ if process.returncode: print >> sys.stderr, "Error occurred:",
process.returncode
def Run():
lint(sys.argv[1])
On 30/12/2011, at 16:47 , Derek Harland wrote:
> Hi,
>
> * I've attached a small patch to improve the emacs-integration module epylint.
> * When opening a subprocess it now ensures that it uses the same version of
> python, and the same pylint package that the original epylint process is
> running under.
> * This helps those of us who run multiple python versions or virtualenv's
>
> derek.
>
> ---
> /Volumes/MacData/Users/derek/py-virtualenv/production-2.7/lib/python2.7/site-packages/pylint/epylint.py
> 2011-12-30 16:15:52.000000000 +1300
> +++
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylint/epylint.py
> 2011-08-01 14:00:12.000000000 +1200
> @@ -57,10 +57,11 @@
> childPath = os.path.join(os.path.basename(parentPath), childPath)
> parentPath = os.path.dirname(parentPath)
>
> - # Ensure we use the python and pylint associated with the running epylint
> - lintPath = os.path.join(os.path.dirname(__file__), 'lint.py')
> - cmd = '%s %s -f parseable -r n --disable=C,R,I "%s"' % (sys.executable,
> lintPath, childPath)
> - process = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE,
> cwd=parentPath)
> + # Start pylint
> + process = Popen('pylint-2.7 -f parseable -r n --disable=C,R,I "%s"' %
> + childPath, shell=True, stdout=PIPE, stderr=PIPE,
> + cwd=parentPath)
> + p = process.stdout
>
> # The parseable line format is '%(path)s:%(line)s: [%(sigle)s%(obj)s]
> %(msg)s'
> # NOTE: This would be cleaner if we added an Emacs reporter to
> pylint.reporters.text ..
> @@ -75,7 +76,7 @@
> # replace as "Warning (W0511, funcName): Warning Text"
> return "%s (%s%s):" % (replacement, mObj.group("type"),
> mObj.group("remainder"))
>
> - for line in process.stdout:
> + for line in p:
> # remove pylintrc warning
> if line.startswith("No config file found"):
> continue
> @@ -86,9 +87,7 @@
> line = ":".join([filename] + parts[1:])
> print line,
>
> - # was there an error?
> - process.wait()
> - if process.returncode: print >> sys.stderr, "Error occurred:",
> process.returncode
> + p.close()
>
> def Run():
> lint(sys.argv[1])
>
> _______________________________________________
> Python-Projects mailing list
> [email protected]
> http://lists.logilab.org/mailman/listinfo/python-projects
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects