You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2018/07/16 08:10:40 UTC

[GitHub] oschaaf closed pull request #9: Define unicode() for Python 3

oschaaf closed pull request #9: Define unicode() for Python 3
URL: https://github.com/apache/incubator-pagespeed-drp/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/registry_tables_generator/registry_tables_generator.py b/src/registry_tables_generator/registry_tables_generator.py
index 5b2297c..7b0e55e 100755
--- a/src/registry_tables_generator/registry_tables_generator.py
+++ b/src/registry_tables_generator/registry_tables_generator.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.4
+#!/usr/bin/env python2
 #
 # Copyright 2011 Google Inc. All Rights Reserved.
 #
@@ -96,6 +96,11 @@
 import test_table_builder
 import trie_node
 
+try:
+  unicode        # Python 2
+except NameError:
+  unicode = str  # Python 3
+
 
 def _ReadRulesFromFile(infile):
   """Read the given dat file and generate a list of all rules.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services