Skip to content

Commit

Permalink
Python 3 integer division is weird... well, different from... python2…
Browse files Browse the repository at this point in the history
…. And the modulus comparison below will result in different formatting without an explicit cast to int here.
  • Loading branch information
klendathu2k committed Feb 5, 2024
1 parent 81b8b2b commit 7423453
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mgr/Dyson/Export/Mortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def __call__(self, line, indent=True, cchar=',', lstrip=True, debug=False, break

if ( indent and lstrip ):
line = line.lstrip() # remove whitespace on left
#self.sepline(line) # print separators

if ( indent ):
self.decrease(line) # decrease indentation level
Expand All @@ -146,11 +145,9 @@ def __call__(self, line, indent=True, cchar=',', lstrip=True, debug=False, break
else:
self.cprint (myline+line,cchar,debug,breakers) # print the line

#self.spcline(line) # add space behind line
if ( indent ):
self.increase(line)

#self.update(line)

#
# ================================================
def spcline(self,line):
Expand Down Expand Up @@ -1095,7 +1092,7 @@ def __call__(self,line,cchar=','):
npad = len(pad)

# And this will be the number of fields per line of output
nfields = ( self.limit - npad ) / (myfield+3)
nfields = int( ( self.limit - npad ) / (myfield+3) )

# Counter for the number of fields
ifield = 0
Expand Down

0 comments on commit 7423453

Please sign in to comment.