Changeset 125610


Ignore:
Timestamp:
Sep 22, 2014, 7:53:22 PM (6 years ago)
Author:
g5pw@…
Message:

Use writelines instead of while loop

The writelines method accepts an iterable, so an iterator will work just fine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • users/g5pw/pypi2port/pypi2port.py

    r125609 r125610  
    194194    diff_string = difflib.unified_diff(a, b, "Portfile.orig", "Portfile")
    195195    with open(diff_file, 'w') as d:
    196         try:
    197             while 1:
    198                 d.write(diff_string.next())
    199         except:
    200             pass
     196        d.writelines(diff_string)
    201197
    202198
Note: See TracChangeset for help on using the changeset viewer.