[devtools] Clean up import of f328ec853e18 and use lgc's getlogin. stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 18 Oct 2010 11:04:19 +0200
branchstable
changeset 6535 972bd504daf6
parent 6534 eb8dd7b0bd9d
child 6537 308037210dab
child 6541 9c3821885443
[devtools] Clean up import of f328ec853e18 and use lgc's getlogin. os.getlogin use the unix getlogin which is notoriously bugged.
devtools/qunit.py
--- a/devtools/qunit.py	Mon Oct 18 11:02:22 2010 +0200
+++ b/devtools/qunit.py	Mon Oct 18 11:04:19 2010 +0200
@@ -9,9 +9,8 @@
 
 # imported by default to simplify further import statements
 from logilab.common.testlib import unittest_main, with_tempdir, InnerTest
+from logilab.common.shellutils import getlogin
 
-import os
-from os.path import expanduser
 import cubicweb
 from cubicweb.view import StartupView
 from cubicweb.web.controller import Controller
@@ -54,8 +53,8 @@
         stdout = TemporaryFile()
         stderr = TemporaryFile()
         try:
-            home = expanduser('~')
-            user = os.getlogin()
+            home = osp.expanduser('~')
+            user = getlogin()
             assert os.access(home, os.W_OK), \
                    'No write access to your home directory, Firefox will crash.'\
                    ' Are you sure "%s" is a valid home  for user "%s"' % (home, user)