[yt-svn] commit/yt: MatthewTurk: Merged in jzuhone/yt (pull request #1633)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jul 10 16:49:40 PDT 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/f06003cb29f0/
Changeset:   f06003cb29f0
Branch:      yt
User:        MatthewTurk
Date:        2015-07-10 23:49:31+00:00
Summary:     Merged in jzuhone/yt (pull request #1633)

Making yt update and yt instinfo work with Python 3
Affected #:  2 files

diff -r 7d4877bae33a4739b0f46c78a11eac5b7db711c1 -r f06003cb29f0f743c02cd8543da8385787151677 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -479,10 +479,6 @@
     pass
 
 def update_hg(path, skip_rebuild = False):
-    if sys.version_info >= (3,0,0):
-        print("python-hglib does not currently work with Python 3,")
-        print("so this function is currently disabled.")
-        return -1
     try:
         import hglib
     except ImportError:
@@ -492,7 +488,7 @@
     f = open(os.path.join(path, "yt_updater.log"), "a")
     repo = hglib.open(path)
     repo.pull()
-    ident = repo.identify()
+    ident = repo.identify().decode("utf-8")
     if "+" in ident:
         print("Can't rebuild modules by myself.")
         print("You will have to do this yourself.  Here's a sample commands:")
@@ -510,7 +506,7 @@
     p = subprocess.Popen([sys.executable, "setup.py", "build_ext", "-i"], cwd=path,
                         stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
     stdout, stderr = p.communicate()
-    f.write(stdout)
+    f.write(stdout.decode('utf-8'))
     f.write("\n\n")
     if p.returncode:
         print("BROKEN: See %s" % (os.path.join(path, "yt_updater.log")))
@@ -519,10 +515,6 @@
     print("Updated successfully.")
 
 def get_hg_version(path):
-    if sys.version_info >= (3,0,0):
-        print("python-hglib does not currently work with Python 3,")
-        print("so this function is currently disabled.")
-        return -1
     try:
         import hglib
     except ImportError:

diff -r 7d4877bae33a4739b0f46c78a11eac5b7db711c1 -r f06003cb29f0f743c02cd8543da8385787151677 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -602,7 +602,7 @@
             print()
             print("---")
             print("Version = %s" % yt.__version__)
-            print("Changeset = %s" % vstring.strip())
+            print("Changeset = %s" % vstring.strip().decode("utf-8"))
             print("---")
             print()
             if "site-packages" not in path:
@@ -1019,7 +1019,7 @@
             print()
             print("---")
             print("Version = %s" % yt.__version__)
-            print("Changeset = %s" % vstring.strip())
+            print("Changeset = %s" % vstring.strip().decode("utf-8"))
             print("---")
             print()
             print("This installation CAN be automatically updated.")

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list