summaryrefslogtreecommitdiff
path: root/event_rpcgen.py
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2006-11-19 02:03:43 +0000
committerNiels Provos <provos@gmail.com>2006-11-19 02:03:43 +0000
commit3a15f7d4e4f3de810e2b81634b4e60f286605066 (patch)
tree6170c57b7084fc18f961fdff535bdacbb4906cda /event_rpcgen.py
parent226fd50a99761f5e874e7376d99674ae54b1aeed (diff)
downloadlibevent-3a15f7d4e4f3de810e2b81634b4e60f286605066.tar.gz
make it work with python2.2
svn:r267
Diffstat (limited to 'event_rpcgen.py')
-rwxr-xr-xevent_rpcgen.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/event_rpcgen.py b/event_rpcgen.py
index 881fc08d..b049089a 100755
--- a/event_rpcgen.py
+++ b/event_rpcgen.py
@@ -1189,7 +1189,11 @@ def GetNextStruct(file):
have_c_comment = 0
data = ''
- for line in file:
+ while 1:
+ line = file.readline()
+ if not line:
+ break
+
line_count += 1
line = line[:-1]
@@ -1252,8 +1256,9 @@ def GetNextStruct(file):
def Parse(file):
- """Parses the input file and returns C code and corresponding header
- file."""
+ """
+ Parses the input file and returns C code and corresponding header file.
+ """
entities = []
@@ -1337,8 +1342,8 @@ def main(argv):
filename = argv[1]
- if filename.split('.')[-1] != 'rpc':
- ext = filename.split('.')[-1]
+ ext = filename.split('.')[-1]
+ if ext != 'rpc':
print >>sys.stderr, 'Unrecognized file extension: %s' % ext
sys.exit(1)