Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py3K fix for -i option #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Py3K fix for -i option
The string.rstrip method does not exist in Py3K.
  • Loading branch information
mayfield committed Aug 4, 2015
commit edb937cab72549b621d22e941af9babf1fc48c32
5 changes: 3 additions & 2 deletions pycscope/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-f reffile Use 'reffile' as cross-ref file name instead of 'cscope.out'
-i srclistfile Use the contents of 'srclistfile' as the list of source files to scan"""

import getopt, sys, os, string, re
import getopt, sys, os, re
import keyword, parser, symbol, token


Expand Down Expand Up @@ -117,7 +117,8 @@ def main(argv=None):
if o == "-f":
indexfn = a
if o == "-i":
args.extend(list(map(string.rstrip, open(a, 'r').readlines())))
with open(a) as f:
args.extend(x.rstrip() for x in f)

# Search current dir by default
if len(args) == 0:
Expand Down