[merge] import dependencies for running setup.py on Windows

John Arbash Meinel john at arbash-meinel.com
Mon Oct 13 16:29:57 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> This fixes some circular import problems running the current setup.py
> on Windows.
> 
> 

Well, I only did this fix:


=== modified file 'bzrlib/win32utils.py'
- --- bzrlib/win32utils.py	2008-10-01 05:40:45 +0000
+++ bzrlib/win32utils.py	2008-10-09 23:59:24 +0000
@@ -319,6 +319,7 @@


 def _ensure_unicode(s):
+    from bzrlib import osutils
     if s and type(s) != unicode:
         s = s.decode(osutils.get_user_encoding())
     return s


So I'm not sure it is a circular import problem. Though I guess if you
just add "from bzrlib import osutils" at the top of win32utils.py it
would *become* one.

If it was up to me, I would make the fix:

 def _ensure_unicode(s):
     if s and type(s) != unicode:
+        from bzrlib import osutils
         s = s.decode(osutils.get_user_encoding())
     return s

Since we don't need to import osutils all the time. Otherwise

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjzaXQACgkQJdeBCYSNAAPJAQCgz/1ftDJbvCv2NxYdr2uOqHxn
rXwAn1i5cH7wzLYEAVIGBAWrjJwR+f7P
=ITLh
-----END PGP SIGNATURE-----



More information about the bazaar mailing list