[Python-apps-commits] r6137 - in packages/ocrodjvu/branches/0.4.6/debian/patches (1 file)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Sun Sep 26 15:14:50 UTC 2010


    Date: Sunday, September 26, 2010 @ 15:14:41
  Author: jwilk
Revision: 6137

Rewrite environment-preserving patch to actually allow the program to override environment variables.

Modified:
  packages/ocrodjvu/branches/0.4.6/debian/patches/preserve-environment.diff

Modified: packages/ocrodjvu/branches/0.4.6/debian/patches/preserve-environment.diff
===================================================================
--- packages/ocrodjvu/branches/0.4.6/debian/patches/preserve-environment.diff	2010-09-26 14:48:21 UTC (rev 6136)
+++ packages/ocrodjvu/branches/0.4.6/debian/patches/preserve-environment.diff	2010-09-26 15:14:41 UTC (rev 6137)
@@ -13,16 +13,17 @@
  import signal
  import subprocess
  
-@@ -46,6 +47,12 @@
+@@ -46,6 +47,13 @@
  class Subprocess(subprocess.Popen):
  
      def __init__(self, *args, **kwargs):
-+        env = kwargs.get('env', None)
-+        if env is not None:
-+            env.update(
++        env_override = kwargs.get('env', None)
++        if env_override is not None:
++            kwargs['env'] = env = dict(
 +                (k, v) for k, v in os.environ.iteritems()
 +                if not (k.startswith('LC_') or k in ('LANG', 'LANGUAGE'))
 +            )
++            env.update(env_override)
          subprocess.Popen.__init__(self, *args, **kwargs)
          try:
              self.__command = kwargs['args'][0]




More information about the Python-apps-commits mailing list