File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,10 +29,7 @@ def adjust(self):
2929 if self .index > len (self .filenames ):
3030 raise StopIteration
3131 elif self .index == len (self .filenames ):
32- if not self .proc_id :
33- self .iter = iter (self .custom )
34- else :
35- raise StopIteration
32+ self .iter = iter (self .custom )
3633 else :
3734 current = self .filenames [self .index ]
3835 self .fp = open (current , "r" )
@@ -48,15 +45,13 @@ def closeFP(self):
4845 def next (self ):
4946 retVal = None
5047 while True :
48+ self .counter += 1
5149 try :
5250 retVal = self .iter .next ().rstrip ()
5351 except StopIteration :
5452 self .adjust ()
5553 retVal = self .iter .next ().rstrip ()
56- if not self .proc_count :
57- break
58- self .counter += 1
59- if self .counter % self .proc_count == self .proc_id :
54+ if not self .proc_count or self .counter % self .proc_count == self .proc_id :
6055 break
6156 return retVal
6257
You can’t perform that action at this time.
0 commit comments