[libcxx-commits] [PATCH] D71136: [libcxx] Replace func_name with __name__ for compatibility with Python 3

Sergej Jaskiewicz via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 6 11:28:04 PST 2019


broadwaylamb updated this revision to Diff 232619.
broadwaylamb added a comment.
Herald added a reviewer: mclow.lists.

Replace one more `func_name`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71136/new/

https://reviews.llvm.org/D71136

Files:
  libcxx/utils/libcxx/test/tracing.py


Index: libcxx/utils/libcxx/test/tracing.py
===================================================================
--- libcxx/utils/libcxx/test/tracing.py
+++ libcxx/utils/libcxx/test/tracing.py
@@ -14,7 +14,7 @@
     def wrapper(*args, **kwargs):
         kwarg_strs = ['{}={}'.format(k, v) for (k, v) in kwargs]
         arg_str = ', '.join([str(a) for a in args] + kwarg_strs)
-        call_str = '{}({})'.format(function.func_name, arg_str)
+        call_str = '{}({})'.format(function.__name__, arg_str)
 
         # Perform the call itself, logging before, after, and anything thrown.
         try:
@@ -36,7 +36,7 @@
     for name, member in inspect.getmembers(obj):
         if inspect.ismethod(member):
             # Skip meta-functions, decorate everything else
-            if not member.func_name.startswith('__'):
+            if not member.__name__.startswith('__'):
                 setattr(obj, name, trace_function(member, log_calls,
                                                   log_results, label))
     return obj


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71136.232619.patch
Type: text/x-patch
Size: 1035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191206/4f7fd6bb/attachment-0001.bin>


More information about the libcxx-commits mailing list