[PATCH] D93117: LNT: Fix Perf profiling support
    Thomas Preud'homme via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Dec 11 06:52:04 PST 2020
    
    
  
thopre added inline comments.
================
Comment at: lnt/testing/profile/perf.py:15
+        # Python 3
+        import lnt.testing.profile.cPerf as cPerf
+    except Exception:
----------------
tnfchris wrote:
> thopre wrote:
> > Why did Python2 not require this? Is there some sort of module path set somewhere that does not work for Python3?
> from what I understood, C Python code will be created in the same folder as it's defined in and those folder become the module path.
> I don't know the semantics of Python 2 as I didn't look at it, but 3 would require the full path or module path set somewhere.
> 
> I had looked through the configuration and this was not set anywhere so I opted for using the full import.
Oh I think it's because Python2 defaults to relative import before full import. I would therefore suggest to use instead:
from . import cPerf
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93117/new/
https://reviews.llvm.org/D93117
    
    
More information about the llvm-commits
mailing list