[PATCH] D67534: [LNT] Python 3 support: Minor automatic 2to3 fixups

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 13:51:45 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371896: [LNT] Python 3 support: Minor automatic 2to3 fixups (authored by hubert.reinterpretcast, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D67534?vs=220094&id=220168#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D67534

Files:
  lnt/trunk/lnt/formats/__init__.py
  lnt/trunk/lnt/lnttool/create.py
  lnt/trunk/lnt/server/instance.py
  lnt/trunk/lnt/testing/__init__.py


Index: lnt/trunk/lnt/server/instance.py
===================================================================
--- lnt/trunk/lnt/server/instance.py
+++ lnt/trunk/lnt/server/instance.py
@@ -54,7 +54,7 @@
             raise Exception("Invalid config: %r" % config_path)
 
         config_data = {}
-        exec open(config_path) in config_data
+        exec(open(config_path).read(), config_data)
         config = lnt.server.config.Config.from_data(config_path, config_data)
 
         return Instance(config_path, config, tmpdir)
Index: lnt/trunk/lnt/testing/__init__.py
===================================================================
--- lnt/trunk/lnt/testing/__init__.py
+++ lnt/trunk/lnt/testing/__init__.py
@@ -182,7 +182,7 @@
         self.name = str(name)
         self.info = dict((str(key), str(value))
                          for key, value in info.items())
-        self.data = map(conv_f, data)
+        self.data = list(map(conv_f, data))
 
     def render(self):
         """Return info from this instance in a dictionary that respects
Index: lnt/trunk/lnt/lnttool/create.py
===================================================================
--- lnt/trunk/lnt/lnttool/create.py
+++ lnt/trunk/lnt/lnttool/create.py
@@ -160,7 +160,7 @@
     wsgi_file = open(wsgi_path, 'w')
     wsgi_file.write(kWSGITemplate % locals())
     wsgi_file.close()
-    os.chmod(wsgi_path, 0755)
+    os.chmod(wsgi_path, 0o755)
 
     # Execute an upgrade on the database to initialize the schema.
     lnt.server.db.migrate.update_path(db_path)
Index: lnt/trunk/lnt/formats/__init__.py
===================================================================
--- lnt/trunk/lnt/formats/__init__.py
+++ lnt/trunk/lnt/formats/__init__.py
@@ -12,7 +12,7 @@
 
 formats = [plist, json]
 formats_by_name = dict((f['name'], f) for f in formats)
-format_names = formats_by_name.keys()
+format_names = list(formats_by_name.keys())
 
 
 def get_format(name):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67534.220168.patch
Type: text/x-patch
Size: 1939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190913/2c125e39/attachment.bin>


More information about the llvm-commits mailing list