mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Switch to using six (#1189)
With the Python 2.7 deadline fast approaching, modernize the codebase making use of the modernize module to switch to using six, as well as other upcoming features, such as absolute imports . Stop using 2to3 for Travis, yay!
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from __future__ import absolute_import
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
@@ -153,17 +155,17 @@ def findHeadersAndFiles():
|
||||
elif fullname.endswith(".pyc"):
|
||||
pass
|
||||
else:
|
||||
print "Don't know what to do with", filename
|
||||
print("Don't know what to do with", filename)
|
||||
|
||||
|
||||
def main():
|
||||
for header, filename in findHeadersAndFiles():
|
||||
print "Analyzing", filename
|
||||
print("Analyzing", filename)
|
||||
with open(filename) as f:
|
||||
lines = list(line.rstrip() for line in f)
|
||||
newLines = header.fix(filename, lines)
|
||||
if newLines != lines:
|
||||
print " => actually modifying", filename
|
||||
print(" => actually modifying", filename)
|
||||
with open(filename, "w") as f:
|
||||
for line in newLines:
|
||||
f.write(line + "\n")
|
||||
|
||||
Reference in New Issue
Block a user